Make WordPress Core

Changeset 60967


Ignore:
Timestamp:
10/17/2025 10:42:36 PM (4 weeks ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use more meaningful variable names in Media Library.

Per the Naming Conventions:

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

Follow-up to [31037], [31041], [31562].

Props costdev, mukesh27.
See #63168.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/upload.php

    r59784 r60967  
    153153    );
    154154
    155     $q = $_GET;
     155    $query_string = $_GET;
    156156    // Let JS handle this.
    157     unset( $q['s'] );
    158     $vars   = wp_edit_attachments_query_vars( $q );
    159     $ignore = array( 'mode', 'post_type', 'post_status', 'posts_per_page' );
    160     foreach ( $vars as $key => $value ) {
     157    unset( $query_string['s'] );
     158    $query_vars = wp_edit_attachments_query_vars( $query_string );
     159    $ignore     = array( 'mode', 'post_type', 'post_status', 'posts_per_page' );
     160
     161    foreach ( $query_vars as $key => $value ) {
    161162        if ( ! $value || in_array( $key, $ignore, true ) ) {
    162             unset( $vars[ $key ] );
     163            unset( $query_vars[ $key ] );
    163164        }
    164165    }
     
    169170        array(
    170171            'adminUrl'  => parse_url( self_admin_url(), PHP_URL_PATH ),
    171             'queryVars' => (object) $vars,
     172            'queryVars' => (object) $query_vars,
    172173        )
    173174    );
Note: See TracChangeset for help on using the changeset viewer.