1

I'm using this function to add a tinymce meta box:

add_action( 'add_meta_boxes', function(){
    add_meta_box( 'test_tinymce', 'Test TinyMCE', function( $post ){
         $field_value = get_post_meta( $post->ID, 'test_tinymce', true );
         wp_editor( $field_value, 'test_tinymce_id', array(
            'wpautop'       => true,
            'media_buttons' => false,
            'textarea_name' => 'test_tinymce',
            'textarea_rows' => 10,
            'teeny'         => true
        ) );
    }, null, 'advanced', 'high' );
});
add_action( 'save_post', function( $post_id ){
    if ( ! isset( $_POST['test_tinymce'] ) ) {
        return;
    }
    update_post_meta( $post_id, 'test_tinymce', $_POST['test_tinymce'] );
});

The problem is, WordPress doesn't save this at all. I've seen similar posts on the internet with no resolution.

Any way to get the meta value to save?

Thanks!

  • 1
    The version 5.0.1 fixes this bug. If you use a custom fields plugin like Meta Box, it's also fixed. – Anh Tran Dec 21 '18 at 4:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.