File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -566,21 +566,18 @@ public function admin_page() {
566
566
public function check_options_and_implement () {
567
567
$ options = Options::get_options ();
568
568
if ( $ options ['loadCustomizerCSSBlockEditor ' ] ) {
569
- add_action ('enqueue_block_editor_assets ' , array ( $ this , 'enqueue_custom_css ' ), PHP_INT_MAX );
570
- add_action ('wp_footer ' , array ( $ this , 'enqueue_custom_css ' ), PHP_INT_MAX );
569
+ add_action ('enqueue_block_assets ' , array ( $ this , 'enqueue_custom_css_admin ' ), PHP_INT_MAX );
571
570
}
572
571
}
573
-
574
572
/**
575
- * Function enqueue the custom css from theme customizer using enqueue block assets
573
+ * Function enqueue on wp-edit-blocks
576
574
*/
577
575
578
- public function enqueue_custom_css () {
576
+ public function enqueue_custom_css_admin () {
579
577
$ custom_css = wp_get_custom_css ();
580
- if (!empty ($ custom_css )) {
581
- $ theme = wp_get_theme (); // Get the current theme object
582
- $ theme_handle = $ theme ->get_stylesheet ();
583
- wp_add_inline_style ($ theme_handle , $ custom_css );
578
+ if ( ! empty ( $ custom_css )) {
579
+ wp_add_inline_style ( 'wp-edit-blocks ' , $ custom_css );
584
580
}
585
581
}
582
+
586
583
}
You can’t perform that action at this time.
0 commit comments