[wp-trac] [WordPress Trac] #40064: Deprecate `get_blog_details()`
WordPress Trac
noreply at wordpress.org
Wed Mar 8 16:52:38 UTC 2017
#40064: Deprecate `get_blog_details()`
--------------------------------+------------------------
Reporter: flixos90 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 4.8
Component: Networks and Sites | Version:
Severity: normal | Resolution:
Keywords: | Focuses: multisite
--------------------------------+------------------------
Comment (by spacedmonkey):
Either way, deprecated or not we will have to support the internals of
this function. This function is a mess with a nest of if else statements.
It also generates and number of different caches, which are not used else
where in core. These caches will have to be invalidated forever more if
the code in the function isn't refactored.
Consider the following sql call that appears in the function.
{{{#!php
$blog = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM
$wpdb->blogs WHERE domain IN (%s,%s) AND path = %s ORDER BY
CHAR_LENGTH(domain) DESC", $nowww, $fields['domain'], $fields['path'] ) );
}}}
This query on the blogs table should be removed with the caches it
generates and replaced with wp_site_query. Wp_site_query has caching built
in and is much better maintained, making this function easier to support
going forward.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40064#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list