Visual/Text tabs in wp editor Not Showing

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 ?

Topic wp-editor text html-editor visual-editor metabox Wordpress

Category Web


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.


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') );

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.