Wie viele andere Leute habe ich ein Problem damit, dass TinyMCE HTML-Tags entfernt – insbesondere die leeren, die ich mit Font Awesome verwende.
Ich habe Lösungen recherchiert und ausprobiert, aber nichts hat funktioniert. Ich bin nicht besonders gut mit PHP, aber das Problem, auf das ich stoße, ist folgendes: Jeder sagt, die Funktion tinyMCE.init in der Datei tinymce.js zu ändern. Da ich jedoch die neueste Version von WP verwende, habe ich das nicht. Was ich habe, ist class-wp-editor.php, in der Folgendes lebt:
/*
* For people who really REALLY know what they're doing with TinyMCE
* You can modify $mceInit to add, remove, change elements of the config
* before tinyMCE.init. Setting "valid_elements", "invalid_elements"
* and "extended_valid_elements" can be done through this filter. Best
* is to use the default cleanup by not specifying valid_elements,
* as TinyMCE checks against the full set of HTML 5.0 elements and attributes.
*/
if ( $set['teeny'] ) {
/**
* Filter the teenyMCE config before init.
*
* @since 2.7.0
*
* @param array $mceInit An array with teenyMCE config.
* @param string $editor_id Unique editor identifier, e.g. 'content'.
*/
$mceInit = apply_filters( 'teeny_mce_before_init', $mceInit, $editor_id );
} else {
/**
* Filter the TinyMCE config before init.
*
* @since 2.5.0
*
* @param array $mceInit An array with TinyMCE config.
* @param string $editor_id Unique editor identifier, e.g. 'content'.
*/
$mceInit = apply_filters( 'tiny_mce_before_init', $mceInit, $editor_id );
}
Jetzt weiß ich, dass ich etwas mit valid_elements, Extended_valid_elements oder verify_html tun muss, aber ich weiß nicht, wie ich das machen soll. Ich kann den Kommentaren entnehmen, wo ich es einfügen soll, aber ich weiß nicht, welches ich verwenden soll oder welche Syntax die richtige ist.
Ich habe diese Geige gefunden: http://fiddle.tinymce.com/j9baab/1 aber wie gesagt, ich habe diese Funktion nirgendwo in WP.
Bitte helfen Sie!