Make WordPress Core

Changeset 55724 for trunk


Ignore:
Timestamp:
05/05/2023 12:41:29 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Docs: Correct the placement of @see tags in WP_HTML_Tag_Processor class.

This moves a reference link in ::get_attribute_names_with_prefix() below the code example, so that it is correctly displayed in the Developer Resources.

Includes updating some other @see tags for consistency as per the documentation standards.

Additionally, the example code for WP_HTML_Tag_Processor::get_tag() is updated to show lowercase tag names in the input HTML, so that it does not convey the wrong impression that the uppercase output from ::get_tag() depends on the case of the input HTML.

Follow-up to [55203].

Props dmsnell, johnbillion, audrasjb, SergeyBiryukov.
Fixes #58254.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/html-api/class-wp-html-tag-processor.php

    r55723 r55724  
    254254         * any given time.
    255255         *
    256          * @see set_bookmark()
    257256         * @since 6.2.0
    258257         * @var int
     258         *
     259         * @see WP_HTML_Tag_Processor::set_bookmark()
    259260         */
    260261        const MAX_BOOKMARKS = 10;
     
    264265         * Prevents accidental infinite loops.
    265266         *
    266          * @see seek()
    267267         * @since 6.2.0
    268268         * @var int
     269         *
     270         * @see WP_HTML_Tag_Processor::seek()
    269271         */
    270272        const MAX_SEEK_OPS = 1000;
     
    499501         * Tracks and limits `seek()` calls to prevent accidental infinite loops.
    500502         *
    501          * @see seek
    502503         * @since 6.2.0
    503504         * @var int
     505         *
     506         * @see WP_HTML_Tag_Processor::seek()
    504507         */
    505508        protected $seek_count = 0;
     
    721724         * Skips contents of title and textarea tags.
    722725         *
     726         * @since 6.2.0
     727         *
    723728         * @see https://html.spec.whatwg.org/multipage/parsing.html#rcdata-state
    724          * @since 6.2.0
    725729         *
    726730         * @param string $tag_name – the lowercase tag name which will close the RCDATA region.
     
    12821286         * (they are accumulated in different data formats for performance).
    12831287         *
    1284          * @see $lexical_updates
    1285          * @see $classname_updates
    1286          *
    1287          * @since 6.2.0
     1288         * @since 6.2.0
     1289         *
     1290         * @see WP_HTML_Tag_Processor::$lexical_updates
     1291         * @see WP_HTML_Tag_Processor::$classname_updates
    12881292         *
    12891293         * @return void
     
    17411745         *     - HTML 5 spec
    17421746         *
    1743          * @see https://html.spec.whatwg.org/multipage/syntax.html#attributes-2:ascii-case-insensitive
    1744          *
    17451747         * Example:
    17461748         * ```php
     
    17551757         * @since 6.2.0
    17561758         *
     1759         * @see https://html.spec.whatwg.org/multipage/syntax.html#attributes-2:ascii-case-insensitive
     1760         *
    17571761         * @param string $prefix Prefix of requested attribute names.
    17581762         * @return array|null List of attribute names, or `null` when no tag opener is matched.
     
    17791783         * Example:
    17801784         * ```php
    1781          * $p = new WP_HTML_Tag_Processor( '<DIV CLASS="test">Test</DIV>' );
     1785         * $p = new WP_HTML_Tag_Processor( '<div class="test">Test</div>' );
    17821786         * $p->next_tag() === true;
    17831787         * $p->get_tag() === 'DIV';
     
    20962100         *
    20972101         * @since 6.2.0
    2098          * @see get_updated_html
     2102         *
     2103         * @see WP_HTML_Tag_Processor::get_updated_html()
    20992104         *
    21002105         * @return string The processed HTML.
Note: See TracChangeset for help on using the changeset viewer.