WP_Duotone::output_footer_assets()public staticWP 6.3.0

Outputs all necessary SVG for duotone filters, CSS for classic themes.

Uses the declarations saved in earlier calls to self::enqueue_global_styles_preset and self::enqueue_custom_filter.

Method of the class: WP_Duotone{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = WP_Duotone::output_footer_assets();

Changelog

Since 6.3.0 Introduced.

WP_Duotone::output_footer_assets() code WP 6.5.3

public static function output_footer_assets() {
	if ( ! empty( self::$used_svg_filter_data ) ) {
		echo self::get_svg_definitions( self::$used_svg_filter_data );
	}

	// In block themes, the CSS is added in the head via wp_add_inline_style in the wp_enqueue_scripts action.
	if ( ! wp_is_block_theme() ) {
		$style_tag_id = 'core-block-supports-duotone';
		wp_register_style( $style_tag_id, false );
		if ( ! empty( self::$used_global_styles_presets ) ) {
			wp_add_inline_style( $style_tag_id, self::get_global_styles_presets( self::$used_global_styles_presets ) );
		}
		if ( ! empty( self::$block_css_declarations ) ) {
			wp_add_inline_style( $style_tag_id, wp_style_engine_get_stylesheet_from_css_rules( self::$block_css_declarations ) );
		}
		wp_enqueue_style( $style_tag_id );
	}
}