Block Editor: Restore the Custom Fields display option.

When merging, [44244] and [44260] were committed to trunk the opposite way that they were committed to the 5.0 branch. They were originally committed in [43885] and [43861], respectively.

Due to this switch, a change in how the Custom Fields meta box was registered wasn't merged from the 5.0 branch, causing it to not be registered correctly in trunk.

Props dd32, pento.
Fixes #46028.



git-svn-id: https://develop.svn.wordpress.org/trunk@44648 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2019-01-18 05:25:48 +00:00
parent 7521e95ca2
commit 3132f22932

View File

@ -1463,21 +1463,18 @@ function register_and_do_post_meta_boxes( $post ) {
}
if ( post_type_supports( $post_type, 'custom-fields' ) ) {
$screen = get_current_screen();
if ( ! $screen || ! $screen->is_block_editor() || (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true ) ) {
add_meta_box(
'postcustom',
__( 'Custom Fields' ),
'post_custom_meta_box',
null,
'normal',
'core',
array(
'__back_compat_meta_box' => false,
'__block_editor_compatible_meta_box' => true,
)
);
}
add_meta_box(
'postcustom',
__( 'Custom Fields' ),
'post_custom_meta_box',
null,
'normal',
'core',
array(
'__back_compat_meta_box' => ! (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true ),
'__block_editor_compatible_meta_box' => true,
)
);
}
/**