Opened 9 years ago
Closed 9 years ago
#3015 closed defect (bug) (fixed)
`get_blog_details()` will be deprecated in WordPress 4.8
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 2.6 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Tools - Unit Tests | Keywords: | needs-patch |
| Cc: |
Description (last modified by )
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_SiteandWP_Networkobjects 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 bbPress PHPUnit test suite uses get_blog_details() in the following locations:
https://bbpress.trac.wordpress.org/browser/trunk/tests/phpunit/includes/testcase.php#L282
https://bbpress.trac.wordpress.org/browser/trunk/tests/phpunit/includes/testcase.php#L287
Related: #BuddyPress7326
Change History (4)
#3
in reply to:
↑ 2
@
9 years ago
- Milestone changed from Awaiting Review to 2.6
Replying to johnjamesjacoby:
For our tests,
get_sites()is comparable, but this means tests will fail on lesser WordPress versions without that function.
Thoughts? Should we duplicate the tests for each, or just add
function_existschecks?
We've now a minimum WordPress version of 4.7, so that's not an issue anymore.
That said, I'll follow BP's lead per buddypress:changeset:11254 and rely on WPs go_to() method.
For our tests,
get_sites()is comparable, but this means tests will fail on lesser WordPress versions without that function.Thoughts? Should we duplicate the tests for each, or just add
function_existschecks?