Make WordPress Core


Ignore:
Timestamp:
05/08/2023 07:50:46 PM (13 months 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.
Merges [55724] to the 6.2 branch.
Fixes #58254.

Location:
branches/6.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.2

  • branches/6.2/src/wp-includes/html-api/class-wp-html-tag-processor.php

    r55722 r55728  
    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
     
    17261730     *     - HTML 5 spec
    17271731     *
    1728      * @see https://html.spec.whatwg.org/multipage/syntax.html#attributes-2:ascii-case-insensitive
    1729      *
    17301732     * Example:
    17311733     * ```php
     
    17401742     * @since 6.2.0
    17411743     *
     1744     * @see https://html.spec.whatwg.org/multipage/syntax.html#attributes-2:ascii-case-insensitive
     1745     *
    17421746     * @param string $prefix Prefix of requested attribute names.
    17431747     * @return array|null List of attribute names, or `null` when no tag opener is matched.
     
    17641768     * Example:
    17651769     * ```php
    1766      *     $p = new WP_HTML_Tag_Processor( '<DIV CLASS="test">Test</DIV>' );
     1770     *     $p = new WP_HTML_Tag_Processor( '<div class="test">Test</div>' );
    17671771     *     $p->next_tag() === true;
    17681772     *     $p->get_tag() === 'DIV';
     
    20562060     *
    20572061     * @since 6.2.0
    2058      * @see get_updated_html
     2062     *
     2063     * @see WP_HTML_Tag_Processor::get_updated_html()
    20592064     *
    20602065     * @return string The processed HTML.
Note: See TracChangeset for help on using the changeset viewer.