Use of wp_editor in blurbs causes encoding issues
-
I recently upgraded a client to the latest version of MBT and found that TinyMCE was suddenly available on the teaser blurbs. I thought that was a great addition as it has been a pain to manually add the HTML when needed. However, when I tried using it, saving the HTML resulted in the encoded HTML being returned in the editor. Thus
<strong>The title is this.</strong>
Became:
<strong>The title is this.</strong>
If I used the TinyMCE tools to set the text to bold and saved it, the bold text is saved properly to the DB, but then when the page is redisplayed, the HTML tags are shown. Thus if I save it again, it screws up the HTML because the tags are transformed into the encoded versions. It seems like you are missing something in the display routines that’s causing the HTML to be output as encoded text rather than proper HTML.
To work around this, I’ve had to disable TinyMCE on that field:
add_filter('wp_editor_settings', function( $settings, $editor_id ) { if ($editor_id != 'excerpt') return $settings; $settings['tinymce'] = false; return $settings; }, 10, 2);
- The topic ‘Use of wp_editor in blurbs causes encoding issues’ is closed to new replies.