From 3132f22932215bb8f963fbb739f45766172099aa Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Fri, 18 Jan 2019 05:25:48 +0000 Subject: [PATCH] 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 --- src/wp-admin/includes/meta-boxes.php | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/wp-admin/includes/meta-boxes.php b/src/wp-admin/includes/meta-boxes.php index 805d69cac7..508168a5bf 100644 --- a/src/wp-admin/includes/meta-boxes.php +++ b/src/wp-admin/includes/meta-boxes.php @@ -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, + ) + ); } /**