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.


Built from https://develop.svn.wordpress.org/trunk@44648


git-svn-id: http://core.svn.wordpress.org/trunk@44479 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2019-01-18 05:26:49 +00:00
parent ac79b4e716
commit 9fc53b8461
2 changed files with 13 additions and 16 deletions

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,
)
);
}
/**

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.1-beta1-44647';
$wp_version = '5.1-beta1-44648';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.