Finds the next tag matching the $query.
Parameters
$query
array|string|nulloptional- Which tag name to find, having which class, etc. Default is to find any tag.
tag_name
string|nullWhich tag to find, ornull
for "any tag."match_offset
int|nullFind the Nth tag matching all search criteria.
1 for "first" tag, 3 for "third," etc.
Defaults to first tag.class_name
string|nullTag must contain this whole class name to match.tag_closers
string|null"visit" or "skip": whether to stop on tag closers, e.g. </div>.
Default:
null
Source
* Example:
*
* // Replace an attribute stored with a new value, indices
* // sourced from the lazily-parsed HTML recognizer.
* $start = $attributes['src']->start;
* $length = $attributes['src']->length;
* $modifications[] = new WP_HTML_Text_Replacement( $start, $length, $new_value );
*
* // Correspondingly, something like this will appear in this array.
* $lexical_updates = array(
* WP_HTML_Text_Replacement( 14, 28, 'https://my-site.my-domain/wp-content/uploads/2014/08/kittens.jpg' )
* );
*
* @since 6.2.0
* @var WP_HTML_Text_Replacement[]
*/
protected $lexical_updates = array();
/**
* Tracks and limits `seek()` calls to prevent accidental infinite loops.
User Contributed Notes
You must log in before being able to contribute a note or feedback.