WP_HTML_Processor::is_html_integration_point()
Indicates if the current token is an HTML integration point.
Note that this method must be an instance method with access to the current token, since it needs to examine the attributes of the currently-matched tag, if it's in the MathML namespace. Otherwise it would be required to scan the HTML and ensure that no other accounting is overlooked.
Метод класса: WP_HTML_Processor{}
Хуков нет.
Возвращает
true|false
. Whether the current token is an HTML integration point.
Использование
// private - только в коде основоного (родительского) класса $result = $this->is_html_integration_point(): bool;
Заметки
Список изменений
С версии 6.7.0 | Введена. |
Код WP_HTML_Processor::is_html_integration_point() WP HTML Processor::is html integration point WP 6.8.1
private function is_html_integration_point(): bool { $current_token = $this->state->current_token; if ( ! isset( $current_token ) ) { return false; } if ( 'html' === $current_token->namespace ) { return false; } $tag_name = $current_token->node_name; if ( 'svg' === $current_token->namespace ) { return ( 'DESC' === $tag_name || 'FOREIGNOBJECT' === $tag_name || 'TITLE' === $tag_name ); } if ( 'math' === $current_token->namespace ) { if ( 'ANNOTATION-XML' !== $tag_name ) { return false; } $encoding = $this->get_attribute( 'encoding' ); return ( is_string( $encoding ) && ( 0 === strcasecmp( $encoding, 'application/xhtml+xml' ) || 0 === strcasecmp( $encoding, 'text/html' ) ) ); } $this->bail( 'Should not have reached end of HTML Integration Point detection: check HTML API code.' ); // This unnecessary return prevents tools from inaccurately reporting type errors. return false; }