Skip to content

Commit

Permalink
Restore the order of actions usually fired in edit-form-advanced.php (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Chouby authored and danielbachhuber committed Oct 17, 2018
1 parent c7dc7a9 commit ae9b363
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
1 change: 1 addition & 0 deletions gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
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

0 comments on commit ae9b363

Please sign in to comment.