wp_global_styles_render_svg_filters() WordPress Function

This function is responsible for rendering the SVG filters used by WP_Customize_Manager.

wp_global_styles_render_svg_filters() #

Renders the SVG filters supplied by theme.json.


Description

Note that this doesn’t render the per-block user-defined filters which are handled by wp_render_duotone_support, but it should be rendered before the filtered content in the body to satisfy Safari’s rendering quirks.


Top ↑

Source

File: wp-includes/script-loader.php

function wp_global_styles_render_svg_filters() {
	/*
	 * When calling via the in_admin_header action, we only want to render the
	 * SVGs on block editor pages.
	 */
	if (
		is_admin() &&
		! get_current_screen()->is_block_editor()
	) {
		return;
	}

	$filters = wp_get_global_styles_svg_filters();
	if ( ! empty( $filters ) ) {
		echo $filters;
	}
}


Top ↑

Changelog

Changelog
VersionDescription
5.9.1Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More