Make WordPress Core

Changeset 61309


Ignore:
Timestamp:
11/25/2025 06:53:28 PM (2 weeks ago)
Author:
westonruter
Message:

Twenty Eleven: Improve PHP docblocks with corrected descriptions, missing/corrected tags, and specific types.

Developed in https://github.com/WordPress/wordpress-develop/pull/10482

Props huzaifaalmesbah, dhruvang21, juanfra, sabernhardt, noruzzaman, ravichudasama01, westonruter.
See #64224.
Fixes #64211.

Location:
trunk/src/wp-content/themes/twentyeleven/inc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyeleven/inc/theme-options.php

    r60513 r61309  
    99
    1010/**
    11  * Properly enqueues styles and scripts for our theme options page.
     11 * Enqueues styles and scripts for the theme options page.
    1212 *
    1313 * This function is attached to the admin_enqueue_scripts action hook.
     
    7676 * to allow for finer-grained control for roles and users.
    7777 *
     78 * @since Twenty Eleven 1.1
     79 *
    7880 * @param string $capability The capability used for the page, which is manage_options by default.
    7981 * @return string The capability to actually use.
     
    8587
    8688/**
    87  * Adds a theme options page to the admin menu, including some help documentation.
     89 * Adds the theme options page to the admin menu, including help documentation.
    8890 *
    8991 * This function is attached to the admin_menu action hook.
     
    108110add_action( 'admin_menu', 'twentyeleven_theme_options_add_page' );
    109111
     112/**
     113 * Adds help documentation to the theme options page.
     114 *
     115 * @since Twenty Eleven 1.3
     116 */
    110117function twentyeleven_theme_options_help() {
    111118
     
    145152 *
    146153 * @since Twenty Eleven 1.0
     154 *
     155 * @return array<string, array<string, string>> An associative array of color scheme options.
    147156 */
    148157function twentyeleven_color_schemes() {
     
    167176     * @since Twenty Eleven 1.0
    168177     *
    169      * @param array $color_scheme_options An associative array of color scheme options.
     178     * @param array<string, array<string, string>> $color_scheme_options An associative array of color scheme options.
    170179     */
    171180    return apply_filters( 'twentyeleven_color_schemes', $color_scheme_options );
     
    176185 *
    177186 * @since Twenty Eleven 1.0
     187 *
     188 * @return array<string, array<string, string>> An associative array of layout options.
    178189 */
    179190function twentyeleven_layouts() {
     
    201212     * @since Twenty Eleven 1.0
    202213     *
    203      * @param array $layout_options An associative array of layout options.
     214     * @param array<string, array<string, string>> $layout_options An associative array of layout options.
    204215     */
    205216    return apply_filters( 'twentyeleven_layouts', $layout_options );
     
    211222 * @since Twenty Eleven 1.0
    212223 *
    213  * @return array An array of default theme options.
     224 * @return array<string, string> An array of default theme options.
    214225 */
    215226function twentyeleven_get_default_theme_options() {
     
    229240     * @since Twenty Eleven 1.0
    230241     *
    231      * @param array $default_theme_options An array of default theme options.
     242     * @param array<string, string> $default_theme_options An array of default theme options.
    232243     */
    233244    return apply_filters( 'twentyeleven_default_theme_options', $default_theme_options );
     
    241252 * @param string $color_scheme Optional. Color scheme.
    242253 *                             Default null (or the active color scheme).
    243  * @return string The default link color.
     254 * @return string|false The default link color, or false if not set.
    244255 */
    245256function twentyeleven_get_default_link_color( $color_scheme = null ) {
     
    261272 *
    262273 * @since Twenty Eleven 1.0
     274 *
     275 * @return array<string, string> The theme options array.
    263276 */
    264277function twentyeleven_get_theme_options() {
     
    373386 *
    374387 * @param array $input An array of form input.
     388 * @return array<string, string> An array of sanitized and validated form output.
    375389 */
    376390function twentyeleven_theme_options_validate( $input ) {
     
    402416     * @since Twenty Eleven 1.0
    403417     *
    404      * @param array $output   An array of sanitized form output.
    405      * @param array $input    An array of un-sanitized form input.
    406      * @param array $defaults An array of default theme options.
     418     * @param array<string, string> $output   An array of sanitized form output.
     419     * @param array                 $input    An array of un-sanitized form input.
     420     * @param array<string, string> $defaults An array of default theme options.
    407421     */
    408422    return apply_filters( 'twentyeleven_theme_options_validate', $output, $input, $defaults );
     
    487501 * @since Twenty Eleven 1.0
    488502 *
    489  * @param array $existing_classes An array of existing body classes.
     503 * @param string[] $existing_classes An array of existing body classes.
     504 * @return string[] The filtered array of body classes.
    490505 */
    491506function twentyeleven_layout_classes( $existing_classes ) {
     
    512527     * @since Twenty Eleven 1.0
    513528     *
    514      * @param array $classes        An array of body classes.
    515      * @param string $current_layout The current theme layout.
     529     * @param string[] $classes        An array of body classes.
     530     * @param string   $current_layout The current theme layout.
    516531     */
    517532    $classes = apply_filters( 'twentyeleven_layout_classes', $classes, $current_layout );
     
    522537
    523538/**
    524  * Implements Twenty Eleven theme options into Customizer
     539 * Implements Twenty Eleven theme options into Customizer.
    525540 *
    526541 * @since Twenty Eleven 1.3
  • trunk/src/wp-content/themes/twentyeleven/inc/widgets.php

    r60513 r61309  
    5050     * @since Twenty Eleven 1.0
    5151     *
    52      * @param array $args     An array of standard parameters for widgets in this theme.
    53      * @param array $instance An array of settings for this widget instance.
     52     * @param array                     $args     An array of standard parameters for widgets in this theme.
     53     * @param array<string, string|int> $instance An array of settings for this widget instance.
    5454     */
    5555    public function widget( $args, $instance ) {
     
    157157     *
    158158     * @since Twenty Eleven 1.0
     159     *
     160     * @param array $new_instance New widget instance.
     161     * @param array $old_instance Original widget instance.
     162     * @return array<string, string|int> Updated widget instance.
    159163     */
    160164    public function update( $new_instance, $old_instance ) {
Note: See TracChangeset for help on using the changeset viewer.