Make WordPress Core


Ignore:
Timestamp:
12/16/2018 11:23:38 PM (6 years ago)
Author:
SergeyBiryukov
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.
Merges [43885] to trunk.
See #45282.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/wp-admin/includes/template.php

    r44178 r44244  
    11621162
    11631163                    $i++;
    1164                     $hidden_class = in_array( $box['id'], $hidden ) ? ' hide-if-js' : '';
     1164                    // get_hidden_meta_boxes() doesn't apply in the block editor.
     1165                    $hidden_class = ( ! $screen->is_block_editor() && in_array( $box['id'], $hidden ) ) ? ' hide-if-js' : '';
    11651166                    echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes( $box['id'], $page ) . $hidden_class . '" ' . '>' . "\n";
    11661167                    if ( 'dashboard_browser_nag' != $box['id'] ) {
Note: See TracChangeset for help on using the changeset viewer.