Skip to content

Commit

Permalink
Coding Standards: Use a more meaningful variable name in `WP_List_Tab…
Browse files Browse the repository at this point in the history
…le::months_dropdown()`.

As per the [https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#naming-conventions Naming Conventions]:
> Don't abbreviate variable names unnecessarily; let the code be unambiguous and self-documenting.

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

See #62279.

git-svn-id: https://develop.svn.wordpress.org/trunk@59755 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Feb 3, 2025
1 parent 85d00ec commit f584f79
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/wp-admin/includes/class-wp-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -763,11 +763,11 @@ protected function months_dropdown( $post_type ) {
return;
}

$m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
$selected_month = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
?>
<label for="filter-by-date" class="screen-reader-text"><?php echo get_post_type_object( $post_type )->labels->filter_by_date; ?></label>
<select name="m" id="filter-by-date">
<option<?php selected( $m, 0 ); ?> value="0"><?php _e( 'All dates' ); ?></option>
<option<?php selected( $selected_month, 0 ); ?> value="0"><?php _e( 'All dates' ); ?></option>
<?php
foreach ( $months as $arc_row ) {
if ( 0 === (int) $arc_row->year ) {
Expand All @@ -779,7 +779,7 @@ protected function months_dropdown( $post_type ) {

printf(
"<option %s value='%s'>%s</option>\n",
selected( $m, $year . $month, false ),
selected( $selected_month, $year . $month, false ),
esc_attr( $arc_row->year . $month ),
/* translators: 1: Month name, 2: 4-digit year. */
sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )
Expand Down

0 comments on commit f584f79

Please sign in to comment.