From f77c9bdd84c0d875cc0a76c4517c519cfba59023 Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Fri, 14 Dec 2018 01:54:40 +0000 Subject: [PATCH] Meta Boxes: Sync checks for valid meta boxes from `do_meta_boxes()` to `the_block_editor_meta_boxes()`. Merges [43792] from the 5.0 branch to trunk. Props ocean90. See #45112. git-svn-id: https://develop.svn.wordpress.org/trunk@44141 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/post.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php index c664be627b..2595f69f7c 100644 --- a/src/wp-admin/includes/post.php +++ b/src/wp-admin/includes/post.php @@ -2235,12 +2235,14 @@ function the_block_editor_meta_boxes() { $meta_boxes = (array) $wp_meta_boxes[ $current_screen->id ][ $location ][ $priority ]; foreach ( $meta_boxes as $meta_box ) { - if ( ! empty( $meta_box['title'] ) ) { - $meta_boxes_per_location[ $location ][] = array( - 'id' => $meta_box['id'], - 'title' => $meta_box['title'], - ); + if ( false == $meta_box || ! $meta_box['title'] ) { + continue; } + + $meta_boxes_per_location[ $location ][] = array( + 'id' => $meta_box['id'], + 'title' => $meta_box['title'], + ); } } }