• After version 6.2 update, i notice that my WYSIWYG field not working like it should be.

    I already delete all of my plugins and using standard theme (Twenty Twenty-One). Then just create a normal metabox with WYSIWYG field inside theme’s function.php.

    As first, it seem working fine but when ever i refesh or open the post editor page, as long as the current active tab (before reload the page) is text – the field will work normal but if the current active tab is visual – the content of visual tab will be white blank and uneditable.

    Please hit me back soon if you guys can recreate this bug or not.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Please share the code you have used so that it can be understood.

    Thread Starter enpitsu

    (@enpitsu)

    Thanks for your reply.

    Just add this code to theme file functions.php:

    function add_custom_meta_box() {
    add_meta_box(
    'custom_meta_box',
    'Custom WYSIWYG Field',
    'custom_meta_box_callback',
    'post',
    'normal',
    'high'
    );
    }
    add_action('add_meta_boxes', 'add_custom_meta_box'); function custom_meta_box_callback($post) {
    $content = get_post_meta($post->ID, 'custom_wysiwyg_field', true);
    $editor_id = 'custom_wysiwyg_field';
    $settings = array(
    'textarea_rows' => 10,
    'media_buttons' => true,
    'teeny' => false,
    'textarea_name' => 'custom_wysiwyg_field'
    );
    wp_editor($content, $editor_id, $settings);
    } function save_custom_meta_box_data($post_id) {
    if (array_key_exists('custom_wysiwyg_field', $_POST)) {
    update_post_meta(
    $post_id,
    'custom_wysiwyg_field',
    $_POST['custom_wysiwyg_field']
    );
    }
    }
    add_action('save_post', 'save_custom_meta_box_data');

    Unfortunately, I can’t reproduce the problem you describe with the code you mentioned. I used a wordpress installation in which I activated a child theme from TwentyTwentyOne. I also enabled the Classic Editor plugin to display this instead of the Block Editor. Other than that, there are no customizations to my installation, including nothing to the theme. Then when I edit a post I see the newly added field. If I enter content there in the Visual Editor, it is visible – even after reloading and even after reopening the post.

    My guess based on your description is that some plugin you still have in use is causing a JavaScript error when loading the page, and thus the Visual Editor cannot be loaded. Do you have any other plugins active? Deactivate them as a test.

    Thread Starter enpitsu

    (@enpitsu)

    That odd, i make sure that no plugin is in use, i even reinstall wp all over again. I only see this with Block Editor, the Classic Editor work perfectly fine, also i using chrome.

    In the block editor I don’t even see the added field. How and where do you see it there?

    Thread Starter enpitsu

    (@enpitsu)

    I make a quick demo video, hope this will make you easier to see.

    https://drive.google.com/file/d/15NomozIKXXJy4suw5OMi42R-64dvBFlf/view?usp=sharing

    Very nice demo. With something like this you can see well what you see. I have tried to reproduce this with me – unfortunately still not successful. I see the editor and can enter something in text which is then also visible in Visual.

    I see that you are using Chrome. Do you have an extension that interferes here? I have deactivated all Chrome extensions. In Firefox it also works without problems.

    Thread Starter enpitsu

    (@enpitsu)

    Unfortunately my Chrome don’t have any extensions, i event test this on Microsoft Edge and still see the bug. If i downgrate from ver 6.2 back to 6.1.1, the bug will disappear, re-appear when upgrate to 6.2.

    I have the same issue here with WYSIWYG-Fields by ACF or JetEngine. It works 1 of every 10 reloads of the page. All plugins deactivated – no avail.

    And I have exactly the same problem. I’ve already tried everything. There are no js errors in the console, but an arbitrary WYSIWYG field also behaves strangely.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘WYSIWYG field: visual tab not editable’ is closed to new replies.