Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore the order of actions usually fired in edit-form-advanced.php #10660

Merged
merged 1 commit into from
Oct 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,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();
Expand Down
20 changes: 0 additions & 20 deletions lib/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down