mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-05 07:07:04 +00:00
Block Editor: Hide the Custom Fields meta box option if that meta box has been removed.
Some plugins remove the Custom Fields meta box, particularly when they provide functionality that replaces it. The block editor would correctly not display this meta box in these circumstances, but it still showed the option to display or hide it. Props pento, noisysocks. Merges [43885] to trunk. See #45282. git-svn-id: https://develop.svn.wordpress.org/trunk@44244 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1161,7 +1161,8 @@ function do_meta_boxes( $screen, $context, $object ) {
|
||||
}
|
||||
|
||||
$i++;
|
||||
$hidden_class = in_array( $box['id'], $hidden ) ? ' hide-if-js' : '';
|
||||
// get_hidden_meta_boxes() doesn't apply in the block editor.
|
||||
$hidden_class = ( ! $screen->is_block_editor() && in_array( $box['id'], $hidden ) ) ? ' hide-if-js' : '';
|
||||
echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes( $box['id'], $page ) . $hidden_class . '" ' . '>' . "\n";
|
||||
if ( 'dashboard_browser_nag' != $box['id'] ) {
|
||||
$widget_title = $box['title'];
|
||||
|
||||
Reference in New Issue
Block a user