WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/25/2019 12:47:53 AM (13 months 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/media.php

    r45599 r45667  
    14941494        'show_title' => true,
    14951495    );
    1496     $args         = wp_parse_args( $args, $default_args );
     1496
     1497    $parsed_args = wp_parse_args( $args, $default_args );
    14971498
    14981499    /**
     
    15031504     * @see get_media_item
    15041505     *
    1505      * @param array $args An array of arguments.
     1506     * @param array $parsed_args An array of arguments.
    15061507     */
    1507     $r = apply_filters( 'get_media_item_args', $args );
     1508    $parsed_args = apply_filters( 'get_media_item_args', $parsed_args );
    15081509
    15091510    $toggle_on  = __( 'Show' );
     
    15191520    $type_html       = "<input type='hidden' id='type-of-$attachment_id' value='" . esc_attr( $type ) . "' />";
    15201521
    1521     $form_fields = get_attachment_fields_to_edit( $post, $r['errors'] );
    1522 
    1523     if ( $r['toggle'] ) {
    1524         $class        = empty( $r['errors'] ) ? 'startclosed' : 'startopen';
     1522    $form_fields = get_attachment_fields_to_edit( $post, $parsed_args['errors'] );
     1523
     1524    if ( $parsed_args['toggle'] ) {
     1525        $class        = empty( $parsed_args['errors'] ) ? 'startclosed' : 'startopen';
    15251526        $toggle_links = "
    15261527    <a class='toggle describe-toggle-on' href='#'>$toggle_on</a>
     
    15321533
    15331534    $display_title = ( ! empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case
    1534     $display_title = $r['show_title'] ? "<div class='filename new'><span class='title'>" . wp_html_excerpt( $display_title, 60, '&hellip;' ) . '</span></div>' : '';
     1535    $display_title = $parsed_args['show_title'] ? "<div class='filename new'><span class='title'>" . wp_html_excerpt( $display_title, 60, '&hellip;' ) . '</span></div>' : '';
    15351536
    15361537    $gallery = ( ( isset( $_REQUEST['tab'] ) && 'gallery' == $_REQUEST['tab'] ) || ( isset( $redir_tab ) && 'gallery' == $redir_tab ) );
     
    16101611    );
    16111612
    1612     if ( $r['send'] ) {
    1613         $r['send'] = get_submit_button( __( 'Insert into Post' ), '', "send[$attachment_id]", false );
    1614     }
    1615 
    1616     $delete = empty( $r['delete'] ) ? '' : $r['delete'];
     1613    if ( $parsed_args['send'] ) {
     1614        $parsed_args['send'] = get_submit_button( __( 'Insert into Post' ), '', "send[$attachment_id]", false );
     1615    }
     1616
     1617    $delete = empty( $parsed_args['delete'] ) ? '' : $parsed_args['delete'];
    16171618    if ( $delete && current_user_can( 'delete_post', $attachment_id ) ) {
    16181619        if ( ! EMPTY_TRASH_DAYS ) {
     
    16511652    }
    16521653
    1653     if ( ( $r['send'] || $thumbnail || $delete ) && ! isset( $form_fields['buttons'] ) ) {
    1654         $form_fields['buttons'] = array( 'tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>" . $r['send'] . " $thumbnail $delete</td></tr>\n" );
     1654    if ( ( $parsed_args['send'] || $thumbnail || $delete ) && ! isset( $form_fields['buttons'] ) ) {
     1655        $form_fields['buttons'] = array( 'tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>" . $parsed_args['send'] . " $thumbnail $delete</td></tr>\n" );
    16551656    }
    16561657    $hidden_fields = array();
Note: See TracChangeset for help on using the changeset viewer.