Make WordPress Core


Ignore:
Timestamp:
07/25/2019 12:47:53 AM (4 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-admin/includes/meta-boxes.php

    r45599 r45667  
    493493        $args = $box['args'];
    494494    }
    495     $r                     = wp_parse_args( $args, $defaults );
    496     $tax_name              = esc_attr( $r['taxonomy'] );
    497     $taxonomy              = get_taxonomy( $r['taxonomy'] );
     495    $parsed_args           = wp_parse_args( $args, $defaults );
     496    $tax_name              = esc_attr( $parsed_args['taxonomy'] );
     497    $taxonomy              = get_taxonomy( $parsed_args['taxonomy'] );
    498498    $user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms );
    499499    $comma                 = _x( ',', 'tag delimiter' );
     
    556556        $args = $box['args'];
    557557    }
    558     $r        = wp_parse_args( $args, $defaults );
    559     $tax_name = esc_attr( $r['taxonomy'] );
    560     $taxonomy = get_taxonomy( $r['taxonomy'] );
     558    $parsed_args = wp_parse_args( $args, $defaults );
     559    $tax_name    = esc_attr( $parsed_args['taxonomy'] );
     560    $taxonomy    = get_taxonomy( $parsed_args['taxonomy'] );
    561561    ?>
    562562    <div id="taxonomy-<?php echo $tax_name; ?>" class="categorydiv">
     
    13111311        <td><select name="link_rating" id="link_rating" size="1">
    13121312        <?php
    1313         for ( $r = 0; $r <= 10; $r++ ) {
    1314             echo '<option value="' . $r . '"';
    1315             if ( isset( $link->link_rating ) && $link->link_rating == $r ) {
     1313        for ( $parsed_args = 0; $parsed_args <= 10; $parsed_args++ ) {
     1314            echo '<option value="' . $parsed_args . '"';
     1315            if ( isset( $link->link_rating ) && $link->link_rating == $parsed_args ) {
    13161316                echo ' selected="selected"';
    13171317            }
    1318             echo( '>' . $r . '</option>' );
     1318            echo( '>' . $parsed_args . '</option>' );
    13191319        }
    13201320        ?>
Note: See TracChangeset for help on using the changeset viewer.