WP_HTML_Tag_Processor::get_comment_type(): string|null

Indicates what kind of comment produced the comment node.

Description

Because there are different kinds of HTML syntax which produce comments, the Tag Processor tracks and exposes this as a type for the comment. Nominally only regular HTML comments exist as they are commonly known, but a number of unrelated syntax errors also produce comments.

See also

Return

string|null

Source

public function get_comment_type() {
	if ( self::STATE_COMMENT !== $this->parser_state ) {
		return null;
	}

	return $this->comment_type;
}

Changelog

VersionDescription
6.5.0Introduced.

User Contributed Notes

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