WP_HTML_Tag_Processor::has_class( string $wanted_class ): bool|null

In this article

Returns if a matched tag contains the given ASCII case-insensitive class name.

Parameters

$wanted_classstringrequired
Look for this CSS class name, ASCII case-insensitive.

Return

bool|null Whether the matched tag contains the given class name, or null if not matched.

Source

}

/*
 * The values here look like they reference the opening tag but they reference
 * the closing tag instead. This is why the opening tag values were stored
 * above in a variable. It reads confusingly here, but that's because the
 * functions that skip the contents have moved all the internal cursors past
 * the inner content of the tag.
 */
$this->token_starts_at      = $was_at;
$this->token_length         = $this->bytes_already_parsed - $this->token_starts_at;
$this->text_starts_at       = $tag_ends_at;
$this->text_length          = $this->tag_name_starts_at - $this->text_starts_at;
$this->tag_name_starts_at   = $tag_name_starts_at;
$this->tag_name_length      = $tag_name_length;

Changelog

VersionDescription
6.4.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.