1

I have a wordpress website that i have added custom meta boxes to the post.

Custom meta boxes have an editor using wp_editor(), but the editor is refusing to show the visual/text tabs on the editor panel.

I have deactivating all plugins on my development, and the issue persisted.

Anyone can help me ?

2
  • Can you please edit your question and provide the code you are using to add wp_editor ? That will help the community to find where the problem is and you will get advise. Jan 16, 2016 at 15:24
  • One of the major reason is Yoast SEO plugin. Make sure that Yoast SEO plugin is up to date. Feb 17, 2020 at 14:12

2 Answers 2

1

Without seeing your code I can't say whats wrong but here is a working (tested) example of a metabox with an editor inside that has the visual/text tabs.

add_action( 'add_meta_boxes',  function() { 
    add_meta_box('html_myid_61_section', 'Meta Box Title', 'my_custom_meta_function');
});

function my_custom_meta_function( $post ) {
    $text= get_post_meta($post, 'my_custom_meta' , true );
    wp_editor( htmlspecialchars_decode($text), 'mettaabox_ID', $settings = array('textarea_name'=>'inputName') );
}

add_action( 'save_post', function($post_id) {
    if (!empty($_POST['inputName'])) {
        $data=htmlspecialchars($_POST['inputName']); 
        update_post_meta($post_id, 'my_custom_meta', $datta );
    }
}); 

Consider This...

I don't often recommend plugins BUT I would STRONGLY suggest using Advanced Custom Fields for stuff like this. Its easy to learn and will save you time and frustration! You can make professional admin layouts very fast.

0

You should assign a textarea_name and your editor ID should not contain other symbols other than dash ( - ) and underscores ( _ ).

wp_editor( 'Lorem Ipsum', 'editor-id', array('textarea_name'=>'message') );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.