WordPress + ­?

In one of my projects it’s important that hyphenation can get controlled with ­

Unfortunately WordPress removes that html entity if I enter it in the “text” view of the text editor. How could I achieve that WordPress doesn’t remove it?

Related posts

Leave a Reply

2 comments

  1. shyBy default, most HTML gets removed from the copy in the TinyMCE editor. You can prevent that by adding this to the functions.php file of your active theme.

    function override_mce_options($initArray) {
        $opts = 'shy';
        $initArray['valid_elements'] = $opts;
        $initArray['extended_valid_elements'] = $opts;
        return $initArray;
    }
    add_filter('tiny_mce_before_init', 'override_mce_options');
    

    I revised my answer to change filter from catching all html to just the shy entity, based on my findings here and here. See if that works.

    If not then try this:

    function override_mce_options($initArray) {
        $initArray['entities'] = 'shy'; 
    }
    add_filter('tiny_mce_before_init', 'override_mce_options');