WP_HTML_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_Processor{}
No Hooks.
Return
String|null
.
Usage
$WP_HTML_Processor = new WP_HTML_Processor(); $WP_HTML_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.6.0 | Introduced. |
Since 6.6.0 | Subclassed for the HTML Processor. |
WP_HTML_Processor::get_comment_type() WP HTML Processor::get comment type code WP 6.6.2
public function get_comment_type() { return $this->is_virtual() ? null : parent::get_comment_type(); }