Make WordPress Core

Changeset 62893


Ignore:
Timestamp:
07/29/2026 03:02:41 AM (4 months ago)
Author:
westonruter
Message:

Bundled Themes: Fix hook docblocks and filter arguments.

  • Add the missing variable name to @param tags that document a type and a description but no name, in Twenty Ten, Twenty Eleven, and Twenty Twenty-One.
  • Pass the documented $post argument to the the_permalink filter in Twenty Eleven, Twenty Thirteen, and Twenty Fifteen. The filter gained that parameter in 4.4, but these call sites were never updated, so a callback registered for two arguments received only one.
  • Point Twenty Eleven's widget_title reference comment at wp-includes/widgets/class-wp-widget-pages.php, since wp-includes/default-widgets.php no longer exists. Add the reference comments that were missing altogether for the_permalink in Twenty Thirteen and Twenty Fifteen, and for widget_title in Twenty Fourteen.

These issues were surfaced by the PHPStan extensions under development for this ticket, which are committed separately.

Developed as subset of ​https://github.com/WordPress/wordpress-develop/pull/12022.
Follow-up to r25625, r25627, r33843, r35002, r51304, r60077.

See #65376, #64896.

Location:
trunk/src/wp-content/themes
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyeleven/author.php

    r54884 r62893  
    5858                                                 * @since Twenty Eleven 1.0
    5959                                                 *
    60                                                  * @param int The height and width avatar dimension in pixels. Default 60.
     60                                                 * @param int $size The height and width avatar dimension in pixels. Default 60.
    6161                                                 */
    6262                                                $author_bio_avatar_size = apply_filters( 'twentyeleven_author_bio_avatar_size', 60 );
  • trunk/src/wp-content/themes/twentyeleven/content-status.php

    r57800 r62893  
    4040                                 * @since Twenty Eleven 1.0
    4141                                 *
    42                                  * @param int The height and width avatar dimensions in pixels. Default 65.
     42                                 * @param int $size The height and width avatar dimensions in pixels. Default 65.
    4343                                 */
    4444                                echo get_avatar( get_the_author_meta( 'ID' ), apply_filters( 'twentyeleven_status_avatar', 65 ) );
  • trunk/src/wp-content/themes/twentyeleven/functions.php

    r62442 r62893  
    690690
    691691        /** This filter is documented in wp-includes/link-template.php */
    692         return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() );
     692        return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink(), get_post() );
    693693}
    694694
  • trunk/src/wp-content/themes/twentyeleven/image.php

    r60077 r62893  
    100100                                                                                 * @since Twenty Eleven 1.0
    101101                                                                                 *
    102                                                                                  * @param int The width for the image attachment size in pixels. Default 848.
     102                                                                                 * @param int $size The width for the image attachment size in pixels. Default 848.
    103103                                                                                 */
    104104                                                                                $attachment_size = apply_filters( 'twentyeleven_attachment_size', 848 );
  • trunk/src/wp-content/themes/twentyeleven/inc/widgets.php

    r61309 r62893  
    7171                ob_start();
    7272
    73                 /** This filter is documented in wp-includes/default-widgets.php */
     73                /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
    7474                $args['title'] = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Ephemera', 'twentyeleven' ) : $instance['title'], $instance, $this->id_base );
    7575
  • trunk/src/wp-content/themes/twentyeleven/tag.php

    r48782 r62893  
    3131                                                 * @since Twenty Eleven 1.0
    3232                                                 *
    33                                                  * @param string The default tag description.
     33                                                 * @param string $tag_archive_meta The default tag description.
    3434                                                 */
    3535                                                echo apply_filters( 'tag_archive_meta', '<div class="tag-archive-meta">' . $tag_description . '</div>' );
  • trunk/src/wp-content/themes/twentyfifteen/inc/template-tags.php

    r60521 r62893  
    247247                $has_url = get_url_in_content( get_the_content() );
    248248
    249                 return $has_url ? $has_url : apply_filters( 'the_permalink', get_permalink() );
     249                /** This filter is documented in wp-includes/link-template.php */
     250                return $has_url ? $has_url : apply_filters( 'the_permalink', get_permalink(), get_post() );
    250251        }
    251252endif;
  • trunk/src/wp-content/themes/twentyfourteen/inc/widgets.php

    r62465 r62893  
    114114                $number = ! empty( $instance['number'] ) ? absint( $instance['number'] ) : 2;
    115115                $title  = ! empty( $instance['title'] ) ? $instance['title'] : $format_string;
    116                 $title  = apply_filters( 'widget_title', $title, $instance, $this->id_base );
     116                /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
     117                $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
    117118
    118119                $ephemera = new WP_Query(
  • trunk/src/wp-content/themes/twentyten/functions.php

    r62438 r62893  
    171171                         * @since Twenty Ten 1.0
    172172                         *
    173                          * @param int The default header image width in pixels. Default 940.
     173                         * @param int $width The default header image width in pixels. Default 940.
    174174                         */
    175175                        'width'               => apply_filters( 'twentyten_header_image_width', 940 ),
    … …  
    179179                         * @since Twenty Ten 1.0
    180180                         *
    181                          * @param int The default header image height in pixels. Default 198.
     181                         * @param int $height The default header image height in pixels. Default 198.
    182182                         */
    183183                        'height'              => apply_filters( 'twentyten_header_image_height', 198 ),
  • trunk/src/wp-content/themes/twentythirteen/functions.php

    r62456 r62893  
    740740        $has_url = get_url_in_content( $content );
    741741
    742         return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() );
     742        /** This filter is documented in wp-includes/link-template.php */
     743        return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink(), get_post() );
    743744}
    744745
  • trunk/src/wp-content/themes/twentytwentyone/functions.php

    r62483 r62893  
    582582         * @since Twenty Twenty-One 1.0
    583583         *
    584          * @param string The list of classes. Default empty string.
     584         * @param string $classes The list of classes. Default empty string.
    585585         */
    586586        $classes = apply_filters( 'twentytwentyone_html_classes', '' );
Note: See TracChangeset for help on using the changeset viewer.