Hooks inline styles in the proper place, depending on the active theme.
$stylestringrequired
$priorityintoptional
Default:10
function wp_enqueue_block_support_styles( $style, $priority = 10 ) {
$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";
},
$priority
);
}
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_enqueue_block_support_styles