wp_enqueue_block_support_styles()WP 5.9.1

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

For block themes, it's loaded in the head. For classic ones, it's loaded in the body because the wp_head action happens before the render_block.

No Hooks.

Return

null. Nothing.

Usage

wp_enqueue_block_support_styles( $style );
$style(string) (required)
String containing the CSS styles to be added.

Changelog

Since 5.9.1 Introduced.

Code of wp_enqueue_block_support_styles() WP 6.0

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