[wp-trac] [WordPress Trac] #63541: TinyMCE scripts not loaded when WYSIWYG fields are present in metaboxes with Gutenberg enabled

WordPress Trac noreply at wordpress.org
Fri Jun 6 10:56:20 UTC 2025


#63541: TinyMCE scripts not loaded when WYSIWYG fields are present in metaboxes
with Gutenberg enabled
--------------------------+-----------------------------
 Reporter:  webhamster23  |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Editor        |    Version:  6.8
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 **Summary:**
 When using custom metabox WYSIWYG fields (e.g. via Advanced Custom Fields
 or other meta box frameworks), TinyMCE often fails to initialize properly
 when Gutenberg is enabled, and post_type_supports('editor') is false. This
 results in broken or empty editors (e.g. iframe with empty <body></body>)
 and uninitialized editor instances.

 **Steps to reproduce:**
 Use a custom post type (or page) with 'editor' => false in supports

 Add a WYSIWYG field via ACF (or another plugin using wp_editor() in a
 metabox)

 Enable Gutenberg (Block Editor)

 Visit the edit screen and inspect the rendered WYSIWYG field

 **Expected:**
 TinyMCE should initialize correctly and load the expected editor interface

 **Actual:**
 Editor iframe appears blank or fails to load content. No errors in the
 console other than n is null in tinymce.min.js. The WYSIWYG appears
 unusable.

 **Notes:**
 This works without issue when:

 Classic Editor is enabled (with block editor disabled via
 use_block_editor_for_post_type)

 Gutenberg is manually disabled for the post type

 wp_enqueue_editor() is forced AND post_type_supports('editor') is set to
 true

 **Affected plugin examples:**

 Advanced Custom Fields (WYSIWYG field inside Flexible Content or Metabox)


 **Proposed Improvement:**
 WordPress should not assume that post_type_supports('editor') === false
 means TinyMCE is unnecessary

 If wp_editor() is called in the request (or known WYSIWYG metaboxes
 exist), load the editor stack

 Alternatively, provide a filter to force editor script loading when
 Gutenberg is enabled

 **Suggested Workaround:**
 {{{#!php
 <?php

 add_filter('use_block_editor_for_post_type', function ($use_block,
 $post_type) {
     return in_array($post_type, ['page', 'custom_post_type']) ? false :
 $use_block; }, 10, 2);

 }}}




 **Environment:**
 WordPress 6.8+ and 6.7.2

 Tested with ACF Pro 6.2.4 and 6.4.2

 Happens across multiple installs, themes, plugins

 Kind regards

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63541>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list