WordPress.org

Make WordPress Core

Changeset 38936


Ignore:
Timestamp:
10/25/2016 11:43:01 PM (3 years ago)
Author:
jeremyfelt
Message:

Multisite: Deprecate the blog_details filter.

get_site() has replaced get_blog_details() throughout core and is the recommended way to retrieve a current or single site object.

The blog_details filter is applied when full details are requested from get_blog_details().

To ensure backwards compatibility in the switch to get_site(), this blog_details filter is now applied in WP_Site::get_details() and marked as deprecated with a note to rely instead on the site_details filter introduced in 4.6.

Props flixos90.
See #37102.
Fixes #38491.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

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

    r38630 r38936  
    347347        }
    348348
     349        /** This filter is documented in wp-includes/ms-blogs.php */
     350        $details = apply_filters_deprecated( 'blog_details', array( $details ), '4.7.0', 'site_details' );
     351
    349352        /**
    350353         * Filters a site's extended properties.
  • trunk/src/wp-includes/ms-blogs.php

    r38915 r38936  
    241241     *
    242242     * @since MU
     243     * @deprecated 4.7.0 Use site_details
    243244     *
    244245     * @param object $details The blog details.
    245246     */
    246     $details = apply_filters( 'blog_details', $details );
     247    $details = apply_filters_deprecated( 'blog_details', array( $details ), '4.7.0', 'site_details' );
    247248
    248249    wp_cache_set( $blog_id . $all, $details, 'blog-details' );
Note: See TracChangeset for help on using the changeset viewer.