I use wordpress a lot, i develop for it a lot too!

I have a client website that i have added 10 custom meta boxes to the post edit screen in functions.php . All the meta boxes have an editor using wp_editor()

This all worked find in wordpress 3.8 and 3.9 but now the site has been upgraded to wordpress 4 the editor is refusing to show the visual/text tabs on the editor pane.

I have verified this by deactivating all plugins on my development copy, and the issue persisted. I then installed a second copy of wordpress but 3.9 and the tabs came back!

Any idea why this is happening on wordpress 4?

3 Answers
3

Yes as per @Nibbr Web Development, TinyMCE editor IDs cannot have brackets. Which is the html field ID, so what we will do is create a different but similiar name for the ID attribute and still use our desired name in for the text area field name, like so.

$content = $options['textareafield'];
// editor_id cannot have brackets and must be lowercase
$editor_id = 'textareafield';
// textarea_name in array can have brackets!
$settings = array('media_buttons' => false, 'textarea_name' => 'my_options[textareafield]');
wp_editor($content, $editor_id, $settings);

This should solve this problem. Also for those of you that have problems with the popup windows such as inserting a link.

Leave a Reply

Your email address will not be published. Required fields are marked *