WP_HTML_Tag_Processor::get_comment_type()
Indicates what kind of comment produced the comment node.
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.
Method of the class: WP_HTML_Tag_Processor{}
No Hooks.
Return
String|null
.
Usage
$WP_HTML_Tag_Processor = new WP_HTML_Tag_Processor(); $WP_HTML_Tag_Processor->get_comment_type();
Notes
- See: self::COMMENT_AS_ABRUPTLY_CLOSED_COMMENT
- See: self::COMMENT_AS_CDATA_LOOKALIKE
- See: self::COMMENT_AS_INVALID_HTML
- See: self::COMMENT_AS_HTML_COMMENT
- See: self::COMMENT_AS_PI_NODE_LOOKALIKE
Changelog
Since 6.5.0 | Introduced. |
WP_HTML_Tag_Processor::get_comment_type() WP HTML Tag Processor::get comment type code WP 6.6.2
public function get_comment_type() { if ( self::STATE_COMMENT !== $this->parser_state ) { return null; } return $this->comment_type; }