Skip to content

Instantly share code, notes, and snippets.

@oldrup
Last active April 11, 2023 20:51
Show Gist options
  • Select an option

  • Save oldrup/fa03b1f1e71829e155152475cb35cb83 to your computer and use it in GitHub Desktop.

Select an option

Save oldrup/fa03b1f1e71829e155152475cb35cb83 to your computer and use it in GitHub Desktop.

Revisions

  1. oldrup renamed this gist Feb 27, 2022. 1 changed file with 0 additions and 0 deletions.
  2. oldrup revised this gist Feb 27, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion emove_global_styles_and_svg_filters.php
    Original file line number Diff line number Diff line change
    @@ -7,4 +7,4 @@ function remove_global_styles_and_svg_filters() {

    // This snippet removes the Global Styles and SVG Filters that are mostly if not only used in Full Site Editing in WordPress 5.9.1+
    // Detailed discussion at: https://github.com/WordPress/gutenberg/issues/36834
    //More info on WordPress default filters: https://github.com/WordPress/WordPress/blob/7d139785ea0cc4b1e9aef21a5632351d0d2ae053/wp-includes/default-filters.php#L552
    // WP default filters: https://github.com/WordPress/WordPress/blob/7d139785ea0cc4b1e9aef21a5632351d0d2ae053/wp-includes/default-filters.php
  3. oldrup created this gist Feb 27, 2022.
    10 changes: 10 additions & 0 deletions emove_global_styles_and_svg_filters.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    // Remove Global Styles and SVG Filters from WP 5.9.1 - 2022-02-27
    function remove_global_styles_and_svg_filters() {
    remove_action( 'wp_enqueue_scripts', 'wp_enqueue_global_styles' );
    remove_action( 'wp_body_open', 'wp_global_styles_render_svg_filters' );
    }
    add_action('init', 'remove_global_styles_and_svg_filters');

    // This snippet removes the Global Styles and SVG Filters that are mostly if not only used in Full Site Editing in WordPress 5.9.1+
    // Detailed discussion at: https://github.com/WordPress/gutenberg/issues/36834
    //More info on WordPress default filters: https://github.com/WordPress/WordPress/blob/7d139785ea0cc4b1e9aef21a5632351d0d2ae053/wp-includes/default-filters.php#L552