Make WordPress Core


Ignore:
Timestamp:
10/03/2017 07:40:01 PM (7 years ago)
Author:
flixos90
Message:

Multisite: Improve get_blog_details() by using get_site_by().

get_site_by() is now the preferred way to retrieve a site object by lookup for identifying data. By using a coherent structure and get_sites() internally, it has several advantages over the direct database queries and complex code in get_blog_details(). Therefore get_blog_details() is now a wrapper for get_site_by(), providing backward compatibility fixes where necessary.

Unit tests have been adjusted to account for the blog-details and blog-lookup cache groups, which are no longer needed.

Props spacedmonkey, jeremyfelt, flixos90.
Fixes #40228.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-site.php

    r41162 r41719  
    331331        }
    332332
    333         /** This filter is documented in wp-includes/ms-blogs.php */
     333        /**
     334         * Filters a blog's details.
     335         *
     336         * @since MU (3.0.0)
     337         * @deprecated 4.7.0 Use site_details
     338         *
     339         * @param object $details The blog details.
     340         */
    334341        $details = apply_filters_deprecated( 'blog_details', array( $details ), '4.7.0', 'site_details' );
    335342
Note: See TracChangeset for help on using the changeset viewer.