Make WordPress Core

Ticket #38349: 38349.diff

File 38349.diff, 3.1 KB (added by iamfriendly, 8 years ago)

Replace get_blog_details() with get_site() in all of the wp-admin/network/ screens

  • src/wp-admin/network/site-info.php

    diff --git src/wp-admin/network/site-info.php src/wp-admin/network/site-info.php
    index 0379dc2..d5d5ce4 100644
    if ( ! $id ) { 
    3737        wp_die( __('Invalid site ID.') );
    3838}
    3939
    40 $details = get_blog_details( $id );
     40$details = get_site( $id );
    4141if ( ! $details ) {
    4242        wp_die( __( 'The requested site does not exist.' ) );
    4343}
    if ( isset( $_REQUEST['action'] ) && 'update-site' == $_REQUEST['action'] ) { 
    8484                $blog_data['path'] = $update_parsed_url['path'];
    8585        }
    8686
    87         $existing_details = get_blog_details( $id, false );
     87        $existing_details = get_site( $id );
    8888        $blog_data_checkboxes = array( 'public', 'archived', 'spam', 'mature', 'deleted' );
    8989        foreach ( $blog_data_checkboxes as $c ) {
    9090                if ( ! in_array( $existing_details->$c, array( 0, 1 ) ) ) {
    if ( isset( $_REQUEST['action'] ) && 'update-site' == $_REQUEST['action'] ) { 
    9797        update_blog_details( $id, $blog_data );
    9898
    9999        // Maybe update home and siteurl options.
    100         $new_details = get_blog_details( $id, false );
     100        $new_details = get_site( $id );
    101101
    102102        $old_home_url = trailingslashit( esc_url( get_option( 'home' ) ) );
    103103        $old_home_parsed = parse_url( $old_home_url );
  • src/wp-admin/network/site-settings.php

    diff --git src/wp-admin/network/site-settings.php src/wp-admin/network/site-settings.php
    index 478ba8b..9d13d30 100644
    $id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0; 
    3535if ( ! $id )
    3636        wp_die( __('Invalid site ID.') );
    3737
    38 $details = get_blog_details( $id );
     38$details = get_site( $id );
    3939if ( ! $details ) {
    4040        wp_die( __( 'The requested site does not exist.' ) );
    4141}
  • src/wp-admin/network/site-themes.php

    diff --git src/wp-admin/network/site-themes.php src/wp-admin/network/site-themes.php
    index f4c8f1d..a63eb90 100644
    if ( ! $id ) 
    5858
    5959$wp_list_table->prepare_items();
    6060
    61 $details = get_blog_details( $id );
     61$details = get_site( $id );
    6262if ( ! $details ) {
    6363        wp_die( __( 'The requested site does not exist.' ) );
    6464}
  • src/wp-admin/network/site-users.php

    diff --git src/wp-admin/network/site-users.php src/wp-admin/network/site-users.php
    index 70e097e..83432dc 100644
    $id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0; 
    5151if ( ! $id )
    5252        wp_die( __('Invalid site ID.') );
    5353
    54 $details = get_blog_details( $id );
     54$details = get_site( $id );
    5555if ( ! $details ) {
    5656        wp_die( __( 'The requested site does not exist.' ) );
    5757}
  • src/wp-admin/network/sites.php

    diff --git src/wp-admin/network/sites.php src/wp-admin/network/sites.php
    index 31bf3e9..9dd24e9 100644
    if ( isset( $_GET['action'] ) ) { 
    9191                        wp_die( __( 'Sorry, you are not allowed to change the current site.' ) );
    9292                }
    9393
    94                 $site_details = get_blog_details( $id );
     94                $site_details = get_site( $id );
    9595                $site_address = untrailingslashit( $site_details->domain . $site_details->path );
    9696
    9797                require_once( ABSPATH . 'wp-admin/admin-header.php' );