From 01fbdc0860bacbed366a74361c072161c449c520 Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Sun, 16 Dec 2018 01:55:08 +0000 Subject: [PATCH] Block Editor: Don't show back compat or incompatible meta boxes in Options. Meta boxes that exist for back compat, or that are incompatible with the block editor aren't displayed, so they don't need an option to display or hide them in the Options dialog. Merges [43856] from the 5.0 branch to trunk. Props noisysocks. Fixes #45249. git-svn-id: https://develop.svn.wordpress.org/trunk@44222 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/post.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php index 999e30a289..31e1a1559e 100644 --- a/src/wp-admin/includes/post.php +++ b/src/wp-admin/includes/post.php @@ -2245,6 +2245,16 @@ function the_block_editor_meta_boxes() { continue; } + // If a meta box is just here for back compat, don't show it in the block editor. + if ( isset( $meta_box['args']['__back_compat_meta_box'] ) && $meta_box['args']['__back_compat_meta_box'] ) { + continue; + } + + // If a meta box doesn't work in the block editor, don't show it in the block editor. + if ( isset( $meta_box['args']['__block_editor_compatible_meta_box'] ) && ! $meta_box['args']['__block_editor_compatible_meta_box'] ) { + continue; + } + $meta_boxes_per_location[ $location ][] = array( 'id' => $meta_box['id'], 'title' => $meta_box['title'],