Last active
January 5, 2024 15:56
-
-
Save aletoropov/1d0591aaf887798c306cd7b84e65f3e4 to your computer and use it in GitHub Desktop.
Удаление inline стилей в WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_print_styles', function() | |
{ | |
wp_styles()->add_data( 'jet-smart-filters-inline-css', 'after', '' ); | |
} ); | |
add_action( 'init', 'remove_my_style_stylesheet', PHP_INT_MAX ); | |
function remove_my_style_stylesheet() { | |
wp_deregister_style( 'jet-smart-filters-inline-css' ); | |
} | |
add_action( 'wp_enqueue_scripts', function() { | |
wp_dequeue_style( 'jet-smart-filters' ); | |
}, PHP_INT_MAX ); | |
remove_filter( 'render_block', 'wp_render_layout_support_flag', 10, 2 ); | |
add_filter( 'render_block', function( $block_content, $block ) { | |
if ( $block['blockName'] === 'core/group' ) { | |
return $block_content; | |
} | |
return wp_render_layout_support_flag( $block_content, $block ); | |
}, 10, 2 ); | |
remove_filter( 'render_block', 'wp_render_layout_support_flag', 10, 2 ); | |
remove_filter( 'render_block', 'gutenberg_render_layout_support_flag', 10, 2 ); | |
function prefix_remove_global_styles() { | |
wp_dequeue_style( 'global-styles' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'prefix_remove_global_styles', 100 ); | |
add_action('wp_footer', function () { | |
wp_dequeue_style('core-block-supports'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment