[wp-trac] [WordPress Trac] #59891: Incorrect example for WP_HTML_Tag_Processor class
WordPress Trac
noreply at wordpress.org
Sat Nov 11 15:10:20 UTC 2023
#59891: Incorrect example for WP_HTML_Tag_Processor class
--------------------------+-----------------------------
Reporter: atachibana | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: HTML API | Version: 6.4
Severity: minor | Keywords:
Focuses: |
--------------------------+-----------------------------
This issue was originally reported as https://github.com/WordPress
/Documentation-Issue-Tracker/issues/1362.
The examples in the documentation reference:
https://developer.wordpress.org/reference/classes/wp_html_tag_processor
/#modifying-html-attributes-for-a-found-tag
using the class parameter to query for an existing class on a tag. But the
source code and code function documentation actually only suppor the
class_name property:
The example under Modifying HTML attributes for a found tag should be:
{{{
if ( $tags->next_tag( array( 'class_name' => 'wp-group-block' ) ) ) {
}}}
At least for me in WP 6.3.
Reported by @gaambo via User Contributed Notes.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59891>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list