WP_HTML_Processor::has_self_closing_flag()
Indicates if the currently matched tag contains the self-closing flag.
No HTML elements ought to have the self-closing flag and for those, the self-closing flag will be ignored. For void elements this is benign because they "self close" automatically. For non-void HTML elements though problems will appear if someone intends to use a self-closing element in place of that element with an empty body. For HTML foreign elements and custom elements the self-closing flag determines if they self-close or not.
This function does not determine if a tag is self-closing, but only if the self-closing flag is present in the syntax.
Метод класса: WP_HTML_Processor{}
Хуков нет.
Возвращает
true|false
. Whether the currently matched tag contains the self-closing flag.
Использование
$WP_HTML_Processor = new WP_HTML_Processor(); $WP_HTML_Processor->has_self_closing_flag(): bool;
Список изменений
С версии 6.6.0 | Введена. |
С версии 6.6.0 | Subclassed for the HTML Processor. |
Код WP_HTML_Processor::has_self_closing_flag() WP HTML Processor::has self closing flag WP 6.8.1
public function has_self_closing_flag(): bool { return $this->is_virtual() ? false : parent::has_self_closing_flag(); }