wp_get_global_styles_svg_filters(): string
Returns a string containing the SVGs to be referenced as filters (duotone).
Return
string
Source
File: wp-includes/global-styles-and-settings.php
.
View all references
function wp_get_global_styles_svg_filters() {
/*
* Ignore cache when `WP_DEBUG` is enabled, so it doesn't interfere with the theme
* developer's workflow.
*
* @todo Replace `WP_DEBUG` once an "in development mode" check is available in Core.
*/
$can_use_cached = ! WP_DEBUG;
$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;
}
Changelog
Version | Description |
---|---|
5.9.1 | Introduced. |