Make WordPress Core

Changeset 52584


Ignore:
Timestamp:
01/16/2022 08:38:50 AM (2 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Rename the $val variable to $site for clarity in WP_MS_Users_List_Table::column_blogs().

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

See #54728.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php

    r52583 r52584  
    371371        }
    372372
    373         foreach ( $blogs as $val ) {
    374             if ( ! can_edit_network( $val->site_id ) ) {
     373        foreach ( $blogs as $site ) {
     374            if ( ! can_edit_network( $site->site_id ) ) {
    375375                continue;
    376376            }
    377377
    378             $path         = ( '/' === $val->path ) ? '' : $val->path;
    379             $site_classes = array( 'site-' . $val->site_id );
     378            $path         = ( '/' === $site->path ) ? '' : $site->path;
     379            $site_classes = array( 'site-' . $site->site_id );
    380380            /**
    381381             * Filters the span class for a site listing on the mulisite user list table.
     
    388388             * @param WP_User  $user         WP_User object.
    389389             */
    390             $site_classes = apply_filters( 'ms_user_list_site_class', $site_classes, $val->userblog_id, $val->site_id, $user );
     390            $site_classes = apply_filters( 'ms_user_list_site_class', $site_classes, $site->userblog_id, $site->site_id, $user );
    391391            if ( is_array( $site_classes ) && ! empty( $site_classes ) ) {
    392392                $site_classes = array_map( 'sanitize_html_class', array_unique( $site_classes ) );
     
    395395                echo '<span>';
    396396            }
    397             echo '<a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) . '">' . str_replace( '.' . get_network()->domain, '', $val->domain . $path ) . '</a>';
     397            echo '<a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $site->userblog_id ) ) . '">' . str_replace( '.' . get_network()->domain, '', $site->domain . $path ) . '</a>';
    398398            echo ' <small class="row-actions">';
    399399            $actions         = array();
    400             $actions['edit'] = '<a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) . '">' . __( 'Edit' ) . '</a>';
     400            $actions['edit'] = '<a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $site->userblog_id ) ) . '">' . __( 'Edit' ) . '</a>';
    401401
    402402            $class = '';
    403             if ( 1 === (int) $val->spam ) {
     403            if ( 1 === (int) $site->spam ) {
    404404                $class .= 'site-spammed ';
    405405            }
    406             if ( 1 === (int) $val->mature ) {
     406            if ( 1 === (int) $site->mature ) {
    407407                $class .= 'site-mature ';
    408408            }
    409             if ( 1 === (int) $val->deleted ) {
     409            if ( 1 === (int) $site->deleted ) {
    410410                $class .= 'site-deleted ';
    411411            }
    412             if ( 1 === (int) $val->archived ) {
     412            if ( 1 === (int) $site->archived ) {
    413413                $class .= 'site-archived ';
    414414            }
    415415
    416             $actions['view'] = '<a class="' . $class . '" href="' . esc_url( get_home_url( $val->userblog_id ) ) . '">' . __( 'View' ) . '</a>';
     416            $actions['view'] = '<a class="' . $class . '" href="' . esc_url( get_home_url( $site->userblog_id ) ) . '">' . __( 'View' ) . '</a>';
    417417
    418418            /**
     
    425425             * @param int      $userblog_id The site ID.
    426426             */
    427             $actions = apply_filters( 'ms_user_list_site_actions', $actions, $val->userblog_id );
     427            $actions = apply_filters( 'ms_user_list_site_actions', $actions, $site->userblog_id );
    428428
    429429            $action_count = count( $actions );
Note: See TracChangeset for help on using the changeset viewer.