wpseek.com
A WordPress-centric search engine for devs and theme authors
wp_enqueue_block_support_styles › WordPress Function
Since5.9.1
Deprecatedn/a
› wp_enqueue_block_support_styles ( $style, $priority = 10 )
| Parameters: (2) |
|
| Links: | |
| Defined at: |
|
| Codex: | |
| Change Log: |
|
Hooks inline styles in the proper place, depending on the active theme.
Source
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 ) {
$processor = new WP_HTML_Tag_Processor( '<style></style>' );
$processor->next_tag();
$processor->set_modifiable_text( $style );
echo "{$processor->get_updated_html()}\n";
},
$priority
);
}