Opened 8 years ago
Closed 8 years ago
#7326 closed defect (bug) (fixed)
`get_blog_details()` will be deprecated in WordPress 4.8
Reported by: | netweb | Owned by: | djpaul |
---|---|---|---|
Milestone: | 2.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | needs-patch |
Cc: |
Description
Via https://make.wordpress.org/core/2016/11/04/multisite-focused-changes-in-4-7/
get_blog_details()
replaced withget_site()
A lot of progress has been made over the last few releases to get things in place for this transition. Now thatWP_Site
andWP_Network
objects exist and are accessible with functions likeget_site()
andget_network()
, they can be implemented throughout core.
In WordPress 4.7,get_blog_details()
was replaced throughout core code with the modernget_site()
. The roadmap for this includes deprecatingget_blog_details()
in WordPress 4.8, so take this cycle as a chance to move your code in that direction.
get_site()
is often a direct replacement, thoughget_sites()
can also be used to query for sites when an ID is not available.
See #WP37102 for details on this change.
The BuddyPress PHPUnit test suite uses get_blog_details()
in the following locations:
https://buddypress.trac.wordpress.org/browser/trunk/tests/phpunit/includes/testcase.php#L348
https://buddypress.trac.wordpress.org/browser/trunk/tests/phpunit/includes/testcase.php#L353
Related: #bbPress3015
Those lines are within the horrendous
go_to()
test method, inside a block that only executes if WP < 3.9, so this isn't an immediate priority (this would obviously execute without notice on WP 389, because it's been deprecated in 4.7).It looks like core's test suite has tidied up
go_to()
, and I think I only duplicated the method initially becauseclean_up_global_scope()
was not actually working to clean up everything BP adds to the global scope, and this was the easiest fix rather than debug the entire stuck (see the section under "For BuddyPress, James.").