From ae9b36358f2b22cc88f69353aca99fe7674547a1 Mon Sep 17 00:00:00 2001 From: Chouby Date: Wed, 17 Oct 2018 13:50:48 +0200 Subject: [PATCH] Restore the order of actions usually fired in edit-form-advanced.php (#10660) dbx_post_advanced add_meta_boxes add_meta_boxes_{$post_type} do_meta_boxes edit_form_advanced restored before admin_enqueue_scripts instead of after admin_head --- gutenberg.php | 1 + lib/register.php | 20 -------------------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/gutenberg.php b/gutenberg.php index 6890d8a9abc7fe..8286987826092a 100644 --- a/gutenberg.php +++ b/gutenberg.php @@ -213,6 +213,7 @@ function gutenberg_init( $return, $post ) { * includes/meta-boxes is typically loaded from edit-form-advanced.php. */ require_once ABSPATH . 'wp-admin/includes/meta-boxes.php'; + gutenberg_collect_meta_box_data(); require_once ABSPATH . 'wp-admin/admin-header.php'; the_gutenberg_project(); diff --git a/lib/register.php b/lib/register.php index e6d66164c0423b..1fc63f8c22d6de 100644 --- a/lib/register.php +++ b/lib/register.php @@ -9,26 +9,6 @@ die( 'Silence is golden.' ); } -/** - * Set up global variables so that plugins will add meta boxes as if we were - * using the main editor. - * - * @since 1.5.0 - */ -function gutenberg_trick_plugins_into_registering_meta_boxes() { - global $pagenow; - - if ( in_array( $pagenow, array( 'post.php', 'post-new.php' ), true ) && ! isset( $_REQUEST['classic-editor'] ) ) { - // As early as possible, but after any plugins ( ACF ) that adds meta boxes. - add_action( 'admin_head', 'gutenberg_collect_meta_box_data', 99 ); - } -} -// As late as possible, but before any logic that adds meta boxes. -add_action( - 'plugins_loaded', - 'gutenberg_trick_plugins_into_registering_meta_boxes' -); - /** * Collect information about meta_boxes registered for the current post. *