Make WordPress Core


Ignore:
Timestamp:
11/12/2018 03:37:41 AM (6 years ago)
Author:
pento
Message:

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.
See #45282.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-admin/includes/template.php

    r43839 r43885  
    10771077
    10781078                    $i++;
    1079                     $hidden_class = in_array($box['id'], $hidden) ? ' hide-if-js' : '';
     1079                    // get_hidden_meta_boxes() doesn't apply in the block editor.
     1080                    $hidden_class = ( ! $screen->is_block_editor() && in_array( $box['id'], $hidden ) ) ? ' hide-if-js' : '';
    10801081                    echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . $hidden_class . '" ' . '>' . "\n";
    10811082                    if ( 'dashboard_browser_nag' != $box['id'] ) {
Note: See TracChangeset for help on using the changeset viewer.