Current Path : /storage/v11800/affypharma/public_html/wp-content/plugins/disable-gutenberg/inc/ |
Linux v11800 5.3.0-1023-aws #25~18.04.1-Ubuntu SMP Fri Jun 5 15:19:18 UTC 2020 aarch64
|
Current File : /storage/v11800/affypharma/public_html/wp-content/plugins/disable-gutenberg/inc/plugin-frontend.php |
<?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');
}
}