Skip to content

Commit

Permalink
move block style enqueue into after_setup_theme hook to resolve warni…
Browse files Browse the repository at this point in the history
…ng about is_feed()
  • Loading branch information
mrwweb committed Jul 11, 2024
1 parent 8b91e0f commit edf463d
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions enhanced-embed-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,19 @@ function enqueue_lite_youtube_component() {
);
}

wp_enqueue_block_style(
'core/embed',
array(
'handle' => 'lite-youtube-custom',
'src' => plugins_url( 'css/lite-youtube-custom.css', __FILE__ ),
'path' => plugin_dir_path( __FILE__ ) . '/css/lite-youtube-custom.css',
'ver' => EEB_VERSION,
)
);
add_action( 'after_setup_theme', __NAMESPACE__ . '\enqueue_embed_block_style' );
function enqueue_embed_block_style() {
wp_enqueue_block_style(
'core/embed',
array(
'handle' => 'lite-youtube-custom',
'src' => plugins_url( 'css/lite-youtube-custom.css', __FILE__ ),
'path' => plugin_dir_path( __FILE__ ) . '/css/lite-youtube-custom.css',
'ver' => EEB_VERSION,
)
);
}


/* Pre-2020 Blocks */
add_filter( 'render_block_core-embed/youtube', __NAMESPACE__ . '\replace_youtube_embed_with_web_component', 10, 2 );
Expand Down

0 comments on commit edf463d

Please sign in to comment.