WP_HTML_Processor::is_void( string $tag_name ): bool

Returns whether a given element is an HTML Void Element

Description

area, base, br, col, embed, hr, img, input, link, meta, source, track, wbr

See also

Parameters

$tag_namestringrequired
Name of HTML tag to check.

Return

bool Whether the given tag is an HTML Void Element.

Source

case '-MENU':
case '-NAV':
case '-OL':
case '-PRE':
case '-SEARCH':
case '-SECTION':
case '-SUMMARY':
case '-UL':
	if ( ! $this->state->stack_of_open_elements->has_element_in_scope( $token_name ) ) {
		// @todo Report parse error.
		// Ignore the token.
		return $this->step();
	}

	$this->generate_implied_end_tags();
	if ( ! $this->state->stack_of_open_elements->current_node_is( $token_name ) ) {
		// @todo Record parse error: this error doesn't impact parsing.
	}
	$this->state->stack_of_open_elements->pop_until( $token_name );
	return true;

/*
 * > An end tag whose tag name is "form"
 */

Changelog

VersionDescription
6.4.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.