wp_get_global_styles_svg_filters()
Deprecated from version 6.3.0 SVG generation is handled on a per-block basis in block supports.. It is no longer supported and can be removed in future releases. It is recommended to replace this function with the same one.
Returns a string containing the SVGs to be referenced as filters (duotone).
No Hooks.
Return
String
.
Usage
wp_get_global_styles_svg_filters();
Changelog
Since 5.9.1 | Introduced. |
Deprecated since 6.3.0 | SVG generation is handled on a per-block basis in block supports. |
wp_get_global_styles_svg_filters() wp get global styles svg filters code WP 6.7.1
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; }