From 2257e9b451835bd5db7da5516be48dc854514a70 Mon Sep 17 00:00:00 2001 From: hellofromTonya Date: Tue, 7 Mar 2023 16:48:21 +0000 Subject: [PATCH] HTML API: Document shorthand usage of the next_tag(). Documents the shorthand usage, i.e. `$this->next_tag( 'img' )`, of `WP_HTML_Tag_Processor::next_tag()`. Also includes table alignments and formatting adjustments in the class docs. Follow-up to [55203], [55206]. Props zieladam, poena, dmsnell, costdev, hellofromTonya. Fixes #57863. See #57575. Built from https://develop.svn.wordpress.org/trunk@55477 git-svn-id: http://core.svn.wordpress.org/trunk@55010 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../html-api/class-wp-html-tag-processor.php | 17 +++++++++-------- wp-includes/version.php | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/wp-includes/html-api/class-wp-html-tag-processor.php b/wp-includes/html-api/class-wp-html-tag-processor.php index 0b3dab1ad2..5a9221fc9e 100644 --- a/wp-includes/html-api/class-wp-html-tag-processor.php +++ b/wp-includes/html-api/class-wp-html-tag-processor.php @@ -40,7 +40,7 @@ * Example: * ```php * $tags = new WP_HTML_Tag_Processor( $html ); - * if ( $tags->next_tag( array( 'tag_name' => 'option' ) ) ) { + * if ( $tags->next_tag( 'option' ) ) { * $tags->set_attribute( 'selected', true ); * } * ``` @@ -58,10 +58,11 @@ * $tags->next_tag(); * ``` * - * | Goal | Query | - * |-----------------------------------------------------------|----------------------------------------------------------------------------| - * | Find any tag. | `$tags->next_tag();` | + * | Goal | Query | + * |-----------------------------------------------------------|---------------------------------------------------------------------------------| + * | Find any tag. | `$tags->next_tag();` | * | Find next image tag. | `$tags->next_tag( array( 'tag_name' => 'img' ) );` | + * | Find next image tag (without passing the array). | `$tags->next_tag( 'img' );` | * | Find next tag containing the `fullwidth` CSS class. | `$tags->next_tag( array( 'class_name' => 'fullwidth' ) );` | * | Find next image tag containing the `fullwidth` CSS class. | `$tags->next_tag( array( 'tag_name' => 'img', 'class_name' => 'fullwidth' ) );` | * @@ -1610,7 +1611,7 @@ class WP_HTML_Tag_Processor { * $p->get_attribute( 'enabled' ) === true; * $p->get_attribute( 'aria-label' ) === null; * - * $p->next_tag( array() ) === false; + * $p->next_tag() === false; * $p->get_attribute( 'class' ) === null; * ``` * @@ -1691,7 +1692,7 @@ class WP_HTML_Tag_Processor { * $p->next_tag( array( 'class_name' => 'test' ) ) === true; * $p->get_attribute_names_with_prefix( 'data-' ) === array( 'data-enabled', 'data-test-id' ); * - * $p->next_tag( array() ) === false; + * $p->next_tag() === false; * $p->get_attribute_names_with_prefix( 'data-' ) === null; * ``` * @@ -1722,10 +1723,10 @@ class WP_HTML_Tag_Processor { * Example: * ```php * $p = new WP_HTML_Tag_Processor( '
Test
' ); - * $p->next_tag( array() ) === true; + * $p->next_tag() === true; * $p->get_tag() === 'DIV'; * - * $p->next_tag( array() ) === false; + * $p->next_tag() === false; * $p->get_tag() === null; * ``` * diff --git a/wp-includes/version.php b/wp-includes/version.php index 3fa627082f..cc9149415c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.2-beta4-55476'; +$wp_version = '6.2-beta4-55477'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.