wp_enqueue_block_support_styles( string $style, int $priority = 10 )

Hooks inline styles in the proper place, depending on the active theme.


$style string Required
String containing the CSS styles to be added.
$priority int Optional
To set the priority for the add_action.

Default: 10

Top ↑


File: wp-includes/script-loader.php. View all references

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

Top ↑


Version Description
6.1.0 Added the $priority parameter.
For block themes, styles are loaded in the head.
For classic ones, styles are loaded in the body because the wp_head action happens before render_block.
5.9.1 Introduced.

Top ↑

User Contributed Notes

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