Make WordPress Core


Ignore:
Timestamp:
09/05/2022 05:17:21 PM (4 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/class-wp-list-table.php

    r53868 r54071  
    556556                }
    557557
    558                 $out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';
     558                $output = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';
    559559
    560560                $i = 0;
     
    563563                        ++$i;
    564564
    565                         $sep = ( $i < $action_count ) ? ' | ' : '';
    566 
    567                         $out .= "<span class='$action'>$link$sep</span>";
    568                 }
    569 
    570                 $out .= '</div>';
    571 
    572                 $out .= '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details' ) . '</span></button>';
    573 
    574                 return $out;
     565                        $separator = ( $i < $action_count ) ? ' | ' : '';
     566
     567                        $output .= "<span class='$action'>{$link}{$separator}</span>";
     568                }
     569
     570                $output .= '</div>';
     571
     572                $output .= '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details' ) . '</span></button>';
     573
     574                return $output;
    575575        }
    576576
Note: See TracChangeset for help on using the changeset viewer.