Make WordPress Core


Ignore:
Timestamp:
09/05/2022 05:17:21 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use more meaningful variable names for output in the admin.

This renames some variables for clarity, per the Naming Conventions:

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

  • $out is renamed to $output in various list table methods and admin functions.
  • $sep is renamed to $separator in various list table methods and admin functions.

This affects:

  • WP_Comments_List_Table::handle_row_actions()
  • WP_List_Table::row_actions()
  • WP_Media_List_Table::column_default()
  • WP_MS_Sites_List_Table::site_states()
  • WP_MS_Users_List_Table::column_blogs()
  • WP_Terms_List_Table::column_name()
  • _wp_dashboard_recent_comments_row()
  • image_align_input_fields()
  • image_size_input_fields()
  • wp_doc_link_parse()
  • _post_states()
  • _media_states()

Follow-up to [8653], [8692], [8864], [8910], [8911], [8916], [9103], [9153], [10607], [15491], [17793], [32644], [54070].

Props mukesh27, costdev.
See #56448, #55647.

File:
1 edited

Legend:

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

    r53888 r54071  
    11561156    }
    11571157
    1158     $out = array();
     1158    $output = array();
    11591159
    11601160    foreach ( $alignments as $name => $label ) {
    1161         $name  = esc_attr( $name );
    1162         $out[] = "<input type='radio' name='attachments[{$post->ID}][align]' id='image-align-{$name}-{$post->ID}' value='$name'" .
     1161        $name     = esc_attr( $name );
     1162        $output[] = "<input type='radio' name='attachments[{$post->ID}][align]' id='image-align-{$name}-{$post->ID}' value='$name'" .
    11631163            ( $checked == $name ? " checked='checked'" : '' ) .
    11641164            " /><label for='image-align-{$name}-{$post->ID}' class='align image-align-{$name}-label'>$label</label>";
    11651165    }
    11661166
    1167     return implode( "\n", $out );
     1167    return implode( "\n", $output );
    11681168}
    11691169
     
    12001200    }
    12011201
    1202     $out = array();
     1202    $output = array();
    12031203
    12041204    foreach ( $size_names as $size => $label ) {
     
    12361236        $html .= '</div>';
    12371237
    1238         $out[] = $html;
     1238        $output[] = $html;
    12391239    }
    12401240
     
    12421242        'label' => __( 'Size' ),
    12431243        'input' => 'html',
    1244         'html'  => implode( "\n", $out ),
     1244        'html'  => implode( "\n", $output ),
    12451245    );
    12461246}
Note: See TracChangeset for help on using the changeset viewer.