| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /inetpub/wwwroot/engineering/wp-content/plugins/disable-gutenberg/inc/ |
Upload File : |
<?php // Frontend stuff..
function disable_gutenberg_wp_enqueue_scripts() {
global $wp_query;
if (is_admin()) return;
$post_id = isset($wp_query->post->ID) ? $wp_query->post->ID : null;
$options = get_option('disable_gutenberg_options');
$enable = isset($options['styles-enable']) ? $options['styles-enable'] : false;
if (!$enable && !disable_gutenberg_whitelist($post_id)) {
// blocks
wp_dequeue_style('wp-block-library');
wp_dequeue_style('wp-block-library-theme');
// theme.json
wp_dequeue_style('global-styles');
// classic theme
wp_dequeue_style('classic-theme-styles');
// svg
remove_action('wp_enqueue_scripts', 'wp_enqueue_global_styles');
remove_action('wp_body_open', 'wp_global_styles_render_svg_filters');
// global-styles-inline-css
remove_action('wp_enqueue_scripts', 'wp_enqueue_global_styles');
remove_action('wp_footer', 'wp_enqueue_global_styles', 1);
// core-block-supports-inline-css
wp_dequeue_style('core-block-supports');
add_action('wp_footer', function() { wp_dequeue_style('core-block-supports'); }, 5);
}
}