wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



block_core_navigation_overlay_html_has_close_block › WordPress Function

Od7.0.0
Przestarzałyn/a
› block_core_navigation_overlay_html_has_close_block ( $html )
Parametry:
  • (string) $html The rendered overlay HTML.
    Wymagane: Tak
Powrót:
  • (bool) True if a close button element is found.
Zdefiniowane na:
Codex:

Checks if the overlay HTML contains a navigation-overlay-close block.

Uses WP_HTML_Tag_Processor to detect the close button in rendered output, so it works when the overlay uses patterns (pattern content is rendered at output time, not in the block tree).


Źródło

function block_core_navigation_overlay_html_has_close_block( $html ) {
	$tags = new WP_HTML_Tag_Processor( $html );
	return $tags->next_tag(
		array(
			'tag_name'   => 'BUTTON',
			'class_name' => 'wp-block-navigation-overlay-close',
		)
	);
}