Skip to content

Commit

Permalink
Fix the order of init action calls to ensure that overriden blocks works
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Feb 15, 2019
1 parent 14061f9 commit e69baad
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/
function gutenberg_reregister_core_block_types() {
// Blocks directory may not exist if working from a fresh clone.
$blocks_dir = dirname( __FILE__ ) . '/../build/block-library/blocks/';
$blocks_dir = dirname( __DIR__ ) . '/build/block-library/blocks/';
if ( ! file_exists( $blocks_dir ) ) {
return;
}
Expand All @@ -57,8 +57,7 @@ function gutenberg_reregister_core_block_types() {
if ( $registry->is_registered( $block_name ) ) {
$registry->unregister( $block_name );
}

require $blocks_dir . $file;
}
}
add_action( 'init', 'gutenberg_reregister_core_block_types' );
add_action( 'init', 'gutenberg_reregister_core_block_types', 9 );

0 comments on commit e69baad

Please sign in to comment.