[wp-trac] [WordPress Trac] #40064: Deprecate `get_blog_details()`

WordPress Trac noreply at wordpress.org
Fri Mar 17 10:47:58 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 flixos90):

 @stephdau It's a good point that `get_site()` isn't a full replacement for
 `get_blog_details()`. Regarding deprecation, I still think we should
 deprecate that function because of its far-from-optimal approach. But I
 agree, there should be a more straightforward alternative. You can very
 easily replace `get_blog_details()` with a `get_sites()` query and
 `array_shift()` in case you're querying by domain or path, but maybe it
 makes more sense to introduce an additional function `get_site_by()` that
 basically wraps these. `get_site_by()` could then become a direct
 replacement which has all the optimizations that we put into `get_site()`
 and `get_sites()`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40064#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list