Title: wp_get_global_styles_svg_filters
Published: May 25, 2022
Last modified: August 20, 2026

---

# wp_get_global_styles_svg_filters(): string

## In this article

 * [Return](https://developer.wordpress.org/reference/functions/wp_get_global_styles_svg_filters/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_get_global_styles_svg_filters/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wp_get_global_styles_svg_filters/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_get_global_styles_svg_filters/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_get_global_styles_svg_filters/?output_format=md#wp--skip-link--target)

This function has been deprecated since 6.3.0. SVG generation is handled on a per-
block basis in block supports instead.

Returns a string containing the SVGs to be referenced as filters (duotone).

## 󠀁[Return](https://developer.wordpress.org/reference/functions/wp_get_global_styles_svg_filters/?output_format=md#return)󠁿

 string

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_get_global_styles_svg_filters/?output_format=md#source)󠁿

    ```php
    function wp_get_global_styles_svg_filters() {
    	_deprecated_function( __FUNCTION__, '6.3.0' );

    	/*
    	 * Ignore cache when the development mode is set to 'theme', so it doesn't interfere with the theme
    	 * developer's workflow.
    	 */
    	$can_use_cached = ! wp_is_development_mode( 'theme' );
    	$cache_group    = 'theme_json';
    	$cache_key      = 'wp_get_global_styles_svg_filters';
    	if ( $can_use_cached ) {
    		$cached = wp_cache_get( $cache_key, $cache_group );
    		if ( $cached ) {
    			return $cached;
    		}
    	}

    	$supports_theme_json = wp_theme_has_theme_json();

    	$origins = array( 'default', 'theme', 'custom' );
    	if ( ! $supports_theme_json ) {
    		$origins = array( 'default' );
    	}

    	$tree = WP_Theme_JSON_Resolver::get_merged_data();
    	$svgs = $tree->get_svg_filters( $origins );

    	if ( $can_use_cached ) {
    		wp_cache_set( $cache_key, $svgs, $cache_group );
    	}

    	return $svgs;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/deprecated.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/deprecated.php#L5246)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/deprecated.php#L5246-L5278)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_get_global_styles_svg_filters/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_is_development_mode()](https://developer.wordpress.org/reference/functions/wp_is_development_mode/)`wp-includes/load.php` |

Checks whether the site is in the given development mode.

  | 
| [wp_theme_has_theme_json()](https://developer.wordpress.org/reference/functions/wp_theme_has_theme_json/)`wp-includes/global-styles-and-settings.php` |

Checks whether a theme or its parent has a theme.json file.

  | 
| [WP_Theme_JSON_Resolver::get_merged_data()](https://developer.wordpress.org/reference/classes/wp_theme_json_resolver/get_merged_data/)`wp-includes/class-wp-theme-json-resolver.php` |

Returns the data merged from multiple origins.

  | 
| [wp_cache_set()](https://developer.wordpress.org/reference/functions/wp_cache_set/)`wp-includes/cache.php` |

Saves the data to the cache.

  | 
| [wp_cache_get()](https://developer.wordpress.org/reference/functions/wp_cache_get/)`wp-includes/cache.php` |

Retrieves the cache contents from the cache by key and group.

  | 
| [_deprecated_function()](https://developer.wordpress.org/reference/functions/_deprecated_function/)`wp-includes/functions.php` |

Marks a function as deprecated and inform when it has been used.

  |

[Show 2 more](https://developer.wordpress.org/reference/functions/wp_get_global_styles_svg_filters/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/wp_get_global_styles_svg_filters/?output_format=md#)

| Used by | Description | 
| [wp_global_styles_render_svg_filters()](https://developer.wordpress.org/reference/functions/wp_global_styles_render_svg_filters/)`wp-includes/deprecated.php` |

Renders the SVG filters supplied by theme.json.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_get_global_styles_svg_filters/?output_format=md#changelog)󠁿

| Version | Description | 
| [6.3.0](https://developer.wordpress.org/reference/since/6.3.0/) | Deprecated. SVG generation is handled on a per-block basis in block supports. | 
| [5.9.1](https://developer.wordpress.org/reference/since/5.9.1/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_global_styles_svg_filters%2F)
before being able to contribute a note or feedback.