Skip to content

Commit

Permalink
Coding Standards: Rename the $val variable to $site for clarity i…
Browse files Browse the repository at this point in the history
…n `WP_MS_Users_List_Table::column_blogs()`.

Follow-up to [12603], [13918], [16607], [32757], [52583].

See #54728.

git-svn-id: https://develop.svn.wordpress.org/trunk@52584 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Jan 16, 2022
1 parent 815759d commit a0b1f27
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/wp-admin/includes/class-wp-ms-users-list-table.php
Expand Up @@ -370,13 +370,13 @@ public function column_blogs( $user ) {
return;
}

foreach ( $blogs as $val ) {
if ( ! can_edit_network( $val->site_id ) ) {
foreach ( $blogs as $site ) {
if ( ! can_edit_network( $site->site_id ) ) {
continue;
}

$path = ( '/' === $val->path ) ? '' : $val->path;
$site_classes = array( 'site-' . $val->site_id );
$path = ( '/' === $site->path ) ? '' : $site->path;
$site_classes = array( 'site-' . $site->site_id );
/**
* Filters the span class for a site listing on the mulisite user list table.
*
Expand All @@ -387,33 +387,33 @@ public function column_blogs( $user ) {
* @param int $network_id Network ID.
* @param WP_User $user WP_User object.
*/
$site_classes = apply_filters( 'ms_user_list_site_class', $site_classes, $val->userblog_id, $val->site_id, $user );
$site_classes = apply_filters( 'ms_user_list_site_class', $site_classes, $site->userblog_id, $site->site_id, $user );
if ( is_array( $site_classes ) && ! empty( $site_classes ) ) {
$site_classes = array_map( 'sanitize_html_class', array_unique( $site_classes ) );
echo '<span class="' . esc_attr( implode( ' ', $site_classes ) ) . '">';
} else {
echo '<span>';
}
echo '<a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) . '">' . str_replace( '.' . get_network()->domain, '', $val->domain . $path ) . '</a>';
echo '<a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $site->userblog_id ) ) . '">' . str_replace( '.' . get_network()->domain, '', $site->domain . $path ) . '</a>';
echo ' <small class="row-actions">';
$actions = array();
$actions['edit'] = '<a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) . '">' . __( 'Edit' ) . '</a>';
$actions['edit'] = '<a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $site->userblog_id ) ) . '">' . __( 'Edit' ) . '</a>';

$class = '';
if ( 1 === (int) $val->spam ) {
if ( 1 === (int) $site->spam ) {
$class .= 'site-spammed ';
}
if ( 1 === (int) $val->mature ) {
if ( 1 === (int) $site->mature ) {
$class .= 'site-mature ';
}
if ( 1 === (int) $val->deleted ) {
if ( 1 === (int) $site->deleted ) {
$class .= 'site-deleted ';
}
if ( 1 === (int) $val->archived ) {
if ( 1 === (int) $site->archived ) {
$class .= 'site-archived ';
}

$actions['view'] = '<a class="' . $class . '" href="' . esc_url( get_home_url( $val->userblog_id ) ) . '">' . __( 'View' ) . '</a>';
$actions['view'] = '<a class="' . $class . '" href="' . esc_url( get_home_url( $site->userblog_id ) ) . '">' . __( 'View' ) . '</a>';

/**
* Filters the action links displayed next the sites a user belongs to
Expand All @@ -424,7 +424,7 @@ public function column_blogs( $user ) {
* @param string[] $actions An array of action links to be displayed. Default 'Edit', 'View'.
* @param int $userblog_id The site ID.
*/
$actions = apply_filters( 'ms_user_list_site_actions', $actions, $val->userblog_id );
$actions = apply_filters( 'ms_user_list_site_actions', $actions, $site->userblog_id );

$action_count = count( $actions );

Expand Down

0 comments on commit a0b1f27

Please sign in to comment.