WP_HTML_Tag_Processor::matches
Checks whether a given tag and its attributes match the search criteria.
Метод класса: WP_HTML_Tag_Processor{}
Хуков нет.
Возвращает
bool. Whether the given tag and its attribute match the search criteria.
Использование
// private - только в коде основоного (родительского) класса $result = $this->matches(): bool;
Список изменений
| С версии 6.2.0 | Введена. |
Код WP_HTML_Tag_Processor::matches() WP HTML Tag Processor::matches WP 7.1.5
private function matches(): bool {
if ( $this->is_closing_tag && ! $this->stop_on_tag_closers ) {
return false;
}
// Does the tag name match the requested tag name in a case-insensitive manner?
if ( isset( $this->sought_tag_name ) ) {
$tag_name = $this->get_tag();
if (
strlen( $this->sought_tag_name ) !== strlen( $tag_name ) ||
0 !== substr_compare( $tag_name, $this->sought_tag_name, 0, null, true )
) {
return false;
}
}
if ( null !== $this->sought_class_name && ! $this->has_class( $this->sought_class_name ) ) {
return false;
}
return true;
}