Editor: Add custom fields meta box support in the block editor.

This brings support for the custom fields meta box into the new block editor.

The `webpack` and `copy-webpack-plugin` packages have also been updated.

This does not bump the `@wordpress` packages like in [43861] because of conflicts with package versions already installed in `trunk`. The packages will be brought up to date in a subsequent merge.

Merges [43861] and [43863] into trunk.

See #45145.
Fixes #45257.
Built from https://develop.svn.wordpress.org/trunk@44260


git-svn-id: http://core.svn.wordpress.org/trunk@44090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj
2018-12-17 03:52:51 +00:00
parent 6ffafa5bc7
commit bbe9a37b6c
6 changed files with 86 additions and 7 deletions

View File

@@ -1463,11 +1463,21 @@ function register_and_do_post_meta_boxes( $post ) {
}
if ( post_type_supports( $post_type, 'custom-fields' ) ) {
$args = array(
'__back_compat_meta_box' => ! (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true ),
'__block_editor_compatible_meta_box' => true,
);
add_meta_box( 'postcustom', __( 'Custom Fields' ), 'post_custom_meta_box', null, 'normal', 'core', $args );
$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,
)
);
}
}
/**