Make WordPress Core


Ignore:
Timestamp:
07/25/2019 12:47:53 AM (7 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Rename $r variable used with wp_parse_args() to $parsed_args for clarity.

Props freewebmentor.
Fixes #45059.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/deprecated.php

    r45611 r45667  
    431431        );
    432432
    433         $r = wp_parse_args( $args, $defaults );
    434 
    435         return wp_list_bookmarks($r);
     433        $parsed_args = wp_parse_args( $args, $defaults );
     434
     435        return wp_list_bookmarks($parsed_args);
    436436}
    437437
     
    636636        _deprecated_function( __FUNCTION__, '2.1.0', 'wp_list_categories()' );
    637637
    638         $r = wp_parse_args( $args );
     638        $parsed_args = wp_parse_args( $args );
    639639
    640640        // Map to new names.
    641         if ( isset($r['optionall']) && isset($r['all']))
    642                 $r['show_option_all'] = $r['all'];
    643         if ( isset($r['sort_column']) )
    644                 $r['orderby'] = $r['sort_column'];
    645         if ( isset($r['sort_order']) )
    646                 $r['order'] = $r['sort_order'];
    647         if ( isset($r['optiondates']) )
    648                 $r['show_last_update'] = $r['optiondates'];
    649         if ( isset($r['optioncount']) )
    650                 $r['show_count'] = $r['optioncount'];
    651         if ( isset($r['list']) )
    652                 $r['style'] = $r['list'] ? 'list' : 'break';
    653         $r['title_li'] = '';
    654 
    655         return wp_list_categories($r);
     641        if ( isset($parsed_args['optionall']) && isset($parsed_args['all']))
     642                $parsed_args['show_option_all'] = $parsed_args['all'];
     643        if ( isset($parsed_args['sort_column']) )
     644                $parsed_args['orderby'] = $parsed_args['sort_column'];
     645        if ( isset($parsed_args['sort_order']) )
     646                $parsed_args['order'] = $parsed_args['sort_order'];
     647        if ( isset($parsed_args['optiondates']) )
     648                $parsed_args['show_last_update'] = $parsed_args['optiondates'];
     649        if ( isset($parsed_args['optioncount']) )
     650                $parsed_args['show_count'] = $parsed_args['optioncount'];
     651        if ( isset($parsed_args['list']) )
     652                $parsed_args['style'] = $parsed_args['list'] ? 'list' : 'break';
     653        $parsed_args['title_li'] = '';
     654
     655        return wp_list_categories($parsed_args);
    656656}
    657657
     
    893893        );
    894894
    895         $r = wp_parse_args( $args, $defaults );
    896 
    897         return wp_list_bookmarks($r);
     895        $parsed_args = wp_parse_args( $args, $defaults );
     896
     897        return wp_list_bookmarks($parsed_args);
    898898}
    899899
Note: See TracChangeset for help on using the changeset viewer.