Make WordPress Core

Ticket #37102: 37102.patch

File 37102.patch, 6.0 KB (added by spacedmonkey, 10 years ago)
  • src/wp-admin/includes/ms.php

     
    6666                switch_to_blog( $blog_id );
    6767        }
    6868
    69         $blog = get_blog_details( $blog_id );
     69        $blog = get_site( $blog_id );
    7070        /**
    7171         * Fires before a site is deleted.
    7272         *
  • src/wp-admin/ms-delete-site.php

     
    2424        }
    2525}
    2626
    27 $blog = get_blog_details();
     27$blog = get_site();
    2828$user = wp_get_current_user();
    2929
    3030$title = __( 'Delete Site' );
  • src/wp-admin/my-sites.php

     
    2323if ( 'updateblogsettings' == $action && isset( $_POST['primary_blog'] ) ) {
    2424        check_admin_referer( 'update-my-sites' );
    2525
    26         $blog = get_blog_details( (int) $_POST['primary_blog'] );
     26        $blog = get_site( (int) $_POST['primary_blog'] );
    2727        if ( $blog && isset( $blog->domain ) ) {
    2828                update_user_option( $current_user->ID, 'primary_blog', (int) $_POST['primary_blog'], true );
    2929                $updated = true;
  • src/wp-includes/class-wp-xmlrpc-server.php

     
    43604360         * @return array|IXR_Error
    43614361         */
    43624362        protected function _multisite_getUsersBlogs( $args ) {
    4363                 $current_blog = get_blog_details();
     4363                $current_blog = get_site();
    43644364
    43654365                $domain = $current_blog->domain;
    43664366                $path = $current_blog->path . 'xmlrpc.php';
  • src/wp-includes/ms-blogs.php

     
    3838 * @return string Full URL of the blog if found. Empty string if not.
    3939 */
    4040function get_blogaddress_by_id( $blog_id ) {
    41         $bloginfo = get_blog_details( (int) $blog_id );
     41        $bloginfo = get_site( (int) $blog_id );
    4242
    4343        if ( empty( $bloginfo ) ) {
    4444                return '';
    4545        }
    4646
    47         $scheme = parse_url( $bloginfo->home, PHP_URL_SCHEME );
     47        $scheme = parse_url( get_blog_option( $blog, 'home' ), PHP_URL_SCHEME );
    4848        $scheme = empty( $scheme ) ? 'http' : $scheme;
    4949
    5050        return esc_url( $scheme . '://' . $bloginfo->domain . $bloginfo->path );
     
    264264                $blog_id = get_current_blog_id();
    265265        }
    266266
    267         $details = get_blog_details( $blog_id, false );
     267        $details = get_site( $blog_id );
    268268        if ( ! $details ) {
    269269                // Make sure clean_blog_cache() gets the blog ID
    270270                // when the blog has been previously cached as
     
    10351035function get_blog_status( $id, $pref ) {
    10361036        global $wpdb;
    10371037
    1038         $details = get_blog_details( $id, false );
     1038        $details = get_site( $id );
    10391039        if ( $details )
    10401040                return $details->$pref;
    10411041
  • src/wp-includes/ms-deprecated.php

     
    1919 *
    2020 * @since MU
    2121 * @deprecated 3.1.0 Use get_blog_details()
    22  * @see get_blog_details()
     22 * @deprecated 4.6.0 Use get_site()
     23 * @see get_site()
    2324 *
    2425 * @return int Current site ID.
    2526 */
     
    2627function get_dashboard_blog() {
    2728    _deprecated_function( __FUNCTION__, '3.1' );
    2829    if ( $blog = get_site_option( 'dashboard_blog' ) )
    29         return get_blog_details( $blog );
     30        return get_site( $blog );
    3031
    31     return get_blog_details( $GLOBALS['current_site']->blog_id );
     32    return get_site( $GLOBALS['current_site']->blog_id );
    3233}
    3334
    3435/**
  • src/wp-includes/ms-functions.php

     
    5353        if ( false !== $primary_blog ) {
    5454                if ( ! isset( $blogs[ $primary_blog ] ) ) {
    5555                        update_user_meta( $user_id, 'primary_blog', $first_blog->userblog_id );
    56                         $primary = get_blog_details( $first_blog->userblog_id );
     56                        $primary = get_site( $first_blog->userblog_id );
    5757                } else {
    58                         $primary = get_blog_details( $primary_blog );
     58                        $primary = get_site( $primary_blog );
    5959                }
    6060        } else {
    6161                //TODO Review this call to add_user_to_blog too - to get here the user must have a role on this blog?
     
    7171                        foreach ( (array) $blogs as $blog_id => $blog ) {
    7272                                if ( $blog->site_id != $wpdb->siteid )
    7373                                        continue;
    74                                 $details = get_blog_details( $blog_id );
     74                                $details = get_site( $blog_id );
    7575                                if ( is_object( $details ) && $details->archived == 0 && $details->spam == 0 && $details->deleted == 0 ) {
    7676                                        $ret = $blog;
    7777                                        if ( get_user_meta( $user_id , 'primary_blog', true ) != $blog_id )
     
    161161
    162162        if ( !get_user_meta($user_id, 'primary_blog', true) ) {
    163163                update_user_meta($user_id, 'primary_blog', $blog_id);
    164                 $details = get_blog_details($blog_id);
     164                $details = get_site( $blog_id );
    165165                update_user_meta($user_id, 'source_domain', $details->domain);
    166166        }
    167167
  • src/wp-includes/ms-load.php

     
    6868 * @return true|string Returns true on success, or drop-in file to include.
    6969 */
    7070function ms_site_check() {
    71         $blog = get_blog_details();
     71        $blog = get_site();
    7272
    7373        /**
    7474         * Filters checking the status of the current blog.
  • src/wp-includes/user.php

     
    719719                $blog_id = get_current_blog_id();
    720720        }
    721721
    722         $blog = get_blog_details( $blog_id );
     722        $blog = get_site( $blog_id );
    723723
    724724        if ( ! $blog || ! isset( $blog->domain ) || $blog->archived || $blog->spam || $blog->deleted ) {
    725725                return false;