wp_enqueue_block_support_styles( string $style )

This function takes care of adding inline styles in the proper place, depending on the theme in use.


Parameters

$style

(string) (Required) String containing the CSS styles to be added.


Top ↑

Source

File: wp-includes/script-loader.php

function wp_enqueue_block_support_styles( $style ) {
	$action_hook_name = 'wp_footer';
	if ( wp_is_block_theme() ) {
		$action_hook_name = 'wp_head';
	}
	add_action(
		$action_hook_name,
		static function () use ( $style ) {
			echo "<style>$style</style>\n";
		}
	);
}


Top ↑

Changelog

Changelog
Version Description
5.9.1 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.