Gets lowercase names of all attributes matching a given prefix in the current tag.
Description
Note that matching is case-insensitive. This is in accordance with the spec: <blockquote> There must never be two or more attributes on the same start tag whose names are an ASCII case-insensitive match for each other. <ul> <li>HTML 5 spec</li> </ul> </blockquote> Example: $p = new WP_HTML_Tag_Processor( '<div data-ENABLED class="test" DATA-test-id="14">Test</div>' );
$p->next_tag( array( 'class_name' => 'test' ) ) === true;
$p->get_attribute_names_with_prefix( 'data-' ) === array( 'data-enabled', 'data-test-id' );
$p->next_tag() === false;
$p->get_attribute_names_with_prefix( 'data-' ) === null;
Parameters
$prefixstring
Prefix of requested attribute names.
Return
array|null
List of attribute names, or null when no tag opener is matched.
Uses · 2
WP_HTML_Processor::is_virtual()Indicates if the currently-matched token is virtual, created by a stack operation while processing HTML, rather than a token found in the HTML text itself.
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 6.7.7 tag, from src/wp-includes/html-api/class-wp-html-processor.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.