wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



wp_enqueue_block_support_styles › WordPress Function

Desde5.9.1
Obsoleton/a
› wp_enqueue_block_support_styles ( $style, $priority = 10 )
Parâmetros: (2)
  • (string) $style String containing the CSS styles to be added.
    Required: Yes
  • (int) $priority To set the priority for the add_action.
    Required: No
    Padrão: 10
Links:
Definido em:
Codex:
Log de mudanças:
  • 6.1.0

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



Fonte

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