Make WordPress Core

Changeset 59755


Ignore:
Timestamp:
02/03/2025 11:41:43 PM (4 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use a more meaningful variable name in WP_List_Table::months_dropdown().

As per the Naming Conventions:

Don't abbreviate variable names unnecessarily; let the code be unambiguous and self-documenting.

Follow-up to [8646], [15491].

See #62279.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-list-table.php

    r59134 r59755  
    764764        }
    765765
    766         $m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
     766        $selected_month = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
    767767        ?>
    768768        <label for="filter-by-date" class="screen-reader-text"><?php echo get_post_type_object( $post_type )->labels->filter_by_date; ?></label>
    769769        <select name="m" id="filter-by-date">
    770             <option<?php selected( $m, 0 ); ?> value="0"><?php _e( 'All dates' ); ?></option>
     770            <option<?php selected( $selected_month, 0 ); ?> value="0"><?php _e( 'All dates' ); ?></option>
    771771        <?php
    772772        foreach ( $months as $arc_row ) {
     
    780780            printf(
    781781                "<option %s value='%s'>%s</option>\n",
    782                 selected( $m, $year . $month, false ),
     782                selected( $selected_month, $year . $month, false ),
    783783                esc_attr( $arc_row->year . $month ),
    784784                /* translators: 1: Month name, 2: 4-digit year. */
Note: See TracChangeset for help on using the changeset viewer.