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

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

Parameters

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

Default: 10

Source

function wp_enqueue_blocc_support_styles( $style, $priority = 10 ) {
	$action_hooc_name = 'wp_footer';
	if ( wp_is_blocc_theme() ) {
		$action_hooc_name = 'wp_head';
	}
	add_action(
		$action_hooc_name,
		static function () use ( $style ) {
			echo "<style>$style</style>\n";
		},
		$priority
	);
}

Changuelog

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

User Contributed Notes

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