Make WordPress Core

Changeset 59503


Ignore:
Timestamp:
12/10/2024 11:39:06 AM (3 months ago)
Author:
gziolo
Message:

HTML API: Remove nullable from get_breadcrumbs return type

Follow-up [58713]
Props jonsurrell, westonruter, gziolo.
Fixes #62674.

File:
1 edited

Legend:

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

    r59502 r59503  
    11441144     * They always include the entire path from the root HTML node to the matched element.
    11451145     *
    1146      * @todo It could be more efficient to expose a generator-based version of this function
    1147      *       to avoid creating the array copy on tag iteration. If this is done, it would likely
    1148      *       be more useful to walk up the stack when yielding instead of starting at the top.
    1149      *
    1150      * Example
     1146     * Example:
    11511147     *
    11521148     *     $processor = WP_HTML_Processor::create_fragment( '<p><strong><em><img></em></strong></p>' );
     
    11561152     * @since 6.4.0
    11571153     *
    1158      * @return string[]|null Array of tag names representing path to matched node, if matched, otherwise NULL.
    1159      */
    1160     public function get_breadcrumbs(): ?array {
     1154     * @return string[] Array of tag names representing path to matched node.
     1155     */
     1156    public function get_breadcrumbs(): array {
    11611157        return $this->breadcrumbs;
    11621158    }
Note: See TracChangeset for help on using the changeset viewer.