wp_global_styles_render_svg_filters

函数


wp_global_styles_render_svg_filters ( No parameters )
定义位置
  • wp-includes/script-loader.php
    , line 2458
引入
5.9.1
弃用

渲染由theme.json提供的SVG过滤器。

注意,这不会渲染由wp_render_duotone_support处理的每块用户定义的过滤器,但它应该在主体中的过滤器内容之前渲染,以满足Safari的渲染怪癖。

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;
	}
}