WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/13/2013 03:22:48 AM (8 years ago)
Author:
SergeyBiryukov
Message:

Use get_current_site() instead of the $current_site global when possible.

props jeremyfelt.
fixes #25158.

File:
1 edited

Legend:

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

    r25125 r26120  
    2222
    2323    function prepare_items() {
    24         global $s, $mode, $wpdb, $current_site;
     24        global $s, $mode, $wpdb;
     25
     26        $current_site = get_current_site();
    2527
    2628        $mode = ( empty( $_REQUEST['mode'] ) ) ? 'list' : $_REQUEST['mode'];
     
    169171
    170172    function display_rows() {
    171         global $current_site, $mode;
     173        global $mode;
    172174
    173175        $status_list = array(
     
    203205            echo "<tr class='$class'>";
    204206
    205             $blogname = ( is_subdomain_install() ) ? str_replace( '.'.$current_site->domain, '', $blog['domain'] ) : $blog['path'];
     207            $blogname = ( is_subdomain_install() ) ? str_replace( '.' . get_current_site()->domain, '', $blog['domain'] ) : $blog['path'];
    206208
    207209            list( $columns, $hidden ) = $this->get_column_info();
     
    252254                            $actions['edit']    = '<span class="edit"><a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a></span>';
    253255                            $actions['backend'] = "<span class='backend'><a href='" . esc_url( get_admin_url( $blog['blog_id'] ) ) . "' class='edit'>" . __( 'Dashboard' ) . '</a></span>';
    254                             if ( $current_site->blog_id != $blog['blog_id'] ) {
     256                            if ( get_current_site()->blog_id != $blog['blog_id'] ) {
    255257                                if ( get_blog_status( $blog['blog_id'], 'deleted' ) == '1' )
    256258                                    $actions['activate']    = '<span class="activate"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=activateblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( 'You are about to activate the site %s' ), $blogname ) ) ), 'confirm' ) ) . '">' . __( 'Activate' ) . '</a></span>';
Note: See TracChangeset for help on using the changeset viewer.