- Timestamp:
- 03/07/2023 04:46:48 PM (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/html-api/class-wp-html-tag-processor.php
r55469 r55477 41 41 * ```php 42 42 * $tags = new WP_HTML_Tag_Processor( $html ); 43 * if ( $tags->next_tag( array( 'tag_name' => 'option' )) ) {43 * if ( $tags->next_tag( 'option' ) ) { 44 44 * $tags->set_attribute( 'selected', true ); 45 45 * } … … 59 59 * ``` 60 60 * 61 * | Goal | Query |62 * |-----------------------------------------------------------|---------------------------------------------------------------------------- |63 * | Find any tag. | `$tags->next_tag();` |61 * | Goal | Query | 62 * |-----------------------------------------------------------|---------------------------------------------------------------------------------| 63 * | Find any tag. | `$tags->next_tag();` | 64 64 * | Find next image tag. | `$tags->next_tag( array( 'tag_name' => 'img' ) );` | 65 * | Find next image tag (without passing the array). | `$tags->next_tag( 'img' );` | 65 66 * | Find next tag containing the `fullwidth` CSS class. | `$tags->next_tag( array( 'class_name' => 'fullwidth' ) );` | 66 67 * | Find next image tag containing the `fullwidth` CSS class. | `$tags->next_tag( array( 'tag_name' => 'img', 'class_name' => 'fullwidth' ) );` | … … 1611 1612 * $p->get_attribute( 'aria-label' ) === null; 1612 1613 * 1613 * $p->next_tag( array()) === false;1614 * $p->next_tag() === false; 1614 1615 * $p->get_attribute( 'class' ) === null; 1615 1616 * ``` … … 1692 1693 * $p->get_attribute_names_with_prefix( 'data-' ) === array( 'data-enabled', 'data-test-id' ); 1693 1694 * 1694 * $p->next_tag( array()) === false;1695 * $p->next_tag() === false; 1695 1696 * $p->get_attribute_names_with_prefix( 'data-' ) === null; 1696 1697 * ``` … … 1723 1724 * ```php 1724 1725 * $p = new WP_HTML_Tag_Processor( '<DIV CLASS="test">Test</DIV>' ); 1725 * $p->next_tag( array()) === true;1726 * $p->next_tag() === true; 1726 1727 * $p->get_tag() === 'DIV'; 1727 1728 * 1728 * $p->next_tag( array()) === false;1729 * $p->next_tag() === false; 1729 1730 * $p->get_tag() === null; 1730 1731 * ```
Note: See TracChangeset
for help on using the changeset viewer.