[wp-trac] [WordPress Trac] #59400: HTML API: Add matches_breadcrumbs() to HTML Processor for better querying
WordPress Trac
noreply at wordpress.org
Tue Sep 26 08:18:40 UTC 2023
#59400: HTML API: Add matches_breadcrumbs() to HTML Processor for better querying
---------------------------------------------+-----------------------------
Reporter: dmsnell | Owner: Bernhard
| Reiter
Type: enhancement | Status: closed
Priority: normal | Milestone: 6.4
Component: HTML API | Version: trunk
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests commit | Focuses:
---------------------------------------------+-----------------------------
Changes (by Bernhard Reiter):
* owner: (none) => Bernhard Reiter
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"56702" 56702]:
{{{
#!CommitTicketReference repository="" revision="56702"
HTML API: Add `matches_breadcrumbs()` method for better querying.
Inside a `next_tag()` loop it can be challenging to use breadcrumbs
because they are only exposed inside the call to `next_tag()` via the
`$query` arg.
In this patch a new method, `matches_breadcrumbs()`, is exposed which
allows for querying within the `next_tag()` loop for more complicated
queries.
This method exposes a wildcard `*` operator to allow matching ''any HTML
tag'' that the currently-matched tag is a child or descendant of.
Props dmsnell, westonruter, mukesh27.
Fixes #59400.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59400#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list