From b2bd3994d4eb945e71f34d9c0944927a29565d5b Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 29 Oct 2018 04:02:40 +0000 Subject: [PATCH] Meta boxes: Don't show the block editor incompatiblity message when it doesn't apply. We should only be showing this message in the classic editor interface, for meta boxes that are marked as being incompatible with the block editor. Fixes #45207. git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43839 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/template.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/template.php b/src/wp-admin/includes/template.php index 708c8c3a2c..f9c2a799cc 100644 --- a/src/wp-admin/includes/template.php +++ b/src/wp-admin/includes/template.php @@ -1052,6 +1052,7 @@ function do_meta_boxes( $screen, $context, $object ) { if ( false == $box || ! $box['title'] ) continue; + $block_compatible = true; if ( is_array( $box[ 'args' ] ) ) { // If a meta box is just here for back compat, don't show it in the block editor. if ( $screen->is_block_editor() && isset( $box['args']['__back_compat_meta_box'] ) && $box['args']['__back_compat_meta_box'] ) { @@ -1063,7 +1064,6 @@ function do_meta_boxes( $screen, $context, $object ) { continue; } - $block_compatible = true; if ( isset( $box['args']['__block_editor_compatible_meta_box'] ) ) { $block_compatible = (bool) $box['args']['__block_editor_compatible_meta_box']; unset( $box['args']['__block_editor_compatible_meta_box'] ); @@ -1095,7 +1095,7 @@ function do_meta_boxes( $screen, $context, $object ) { echo "

{$box['title']}

\n"; echo '
' . "\n"; - if ( WP_DEBUG && ! $screen->is_block_editor() && ! isset( $_GET['meta-box-loader'] ) ) { + if ( WP_DEBUG && ! $block_compatible && 'edit' === $screen->parent_base && ! $screen->is_block_editor() && ! isset( $_GET['meta-box-loader'] ) ) { if ( is_array( $box['callback'] ) ) { $reflection = new ReflectionMethod( $box['callback'][0], $box['callback'][1] ); } elseif ( false !== strpos( $box['callback'], '::' ) ) {