Skip to content

Commit

Permalink
Merge 1c5bd3b into a82ef8e
Browse files Browse the repository at this point in the history
  • Loading branch information
PatelUtkarsh committed May 17, 2022
2 parents a82ef8e + 1c5bd3b commit e6b5e9b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions theme/inc/block-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*/
function setup() {
add_action( 'init', __NAMESPACE__ . '\\register_disable_section_meta' );
add_action( 'admin_init', __NAMESPACE__ . '\\force_enqueue_block_editor_assets' );
add_action( 'enqueue_block_editor_assets', __NAMESPACE__ . '\\enqueue_block_editor_assets' );
if ( ! is_fse() ) {
add_action( 'body_class', __NAMESPACE__ . '\\filter_body_class' );
Expand All @@ -38,6 +39,21 @@ function setup() {
$overrides_block = new Override();
}

/**
* Force enqueue block editor assets for FSE.
*
* @return void
*/
function force_enqueue_block_editor_assets() {
global $pagenow;
if ( $pagenow !== 'site-editor.php' ) {
return;
}
// Force registration of block editor assets early so .

do_action( 'enqueue_block_editor_assets' );
}

/**
* Register disable section meta.
*/
Expand Down

0 comments on commit e6b5e9b

Please sign in to comment.