WP_HTML_Tag_Processor::change_parsing_namespace( string $new_namespace ): bool

In this article

Switches parsing mode into a new namespace, such as when encountering an SVG tag and entering foreign content.

Parameters

$new_namespacestringrequired
One of 'html', 'svg', or 'math' indicating into what namespace the next tokens will be processed.

Return

bool Whether the namespace was valid and changed.

Source

public function change_parsing_namespace( string $new_namespace ): bool {
	if ( ! in_array( $new_namespace, array( 'html', 'math', 'svg' ), true ) ) {
		return false;
	}

	$this->parsing_namespace = $new_namespace;
	return true;
}

Changelog

VersionDescription
6.7.0Introduced.

User Contributed Notes

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