Opened 9 years ago
Last modified 2 years ago
#37297 reviewing enhancement
Deprecate get_blogaddress_by_id function
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Networks and Sites | Keywords: | needs-patch |
Focuses: | multisite | Cc: |
Description
The get_blogaddress_by_id function is pretty old and should be replaced with get_home_url, as this is filtered.
Attachments (1)
Change History (13)
#3
@
8 years ago
- Keywords 4.7-early removed
- Milestone changed from Awaiting Review to 4.7
- Owner set to jeremyfelt
- Status changed from new to reviewing
Noting #26855 in here as well. Let's see if we can deprecate this early. :)
#4
@
8 years ago
Early is coming to a an end. (whatever early means). @jeremyfelt - Think this can go in, or do you need to do #26855 first?
This ticket was mentioned in Slack in #core-multisite by flixos90. View the logs.
8 years ago
#6
@
8 years ago
- Keywords needs-patch added; has-patch removed
- Owner jeremyfelt deleted
I spent some time with 37297.diff the other day and ran into some uncertainty.
As @thomaswm mentioned, get_home_url()
is not appropriate solution for install_blog()
. get_blogaddress_by_id()
attempts to use the home option to determine the URL's scheme, but it will always be empty at this point. We then know it will be HTTP combined with the site's domain and path.
It does seem to be the right option for wpmu_welcome_notification()
. I'd like this to be tested more though.
The use in wp-activate.php
has already been removed via #26855.
You cannot replace
get_blogaddress_by_id
withget_home_url
ininstall_blog()
, because thehome
option hasn't been defined yet at that point. It is set in line 1360 in ms-functions.php.So, in
install_blog()
, you'll have to do something like$site = get_site( $blog_id ); $url = 'http://' . $site->domain . $site->path;
to get the value of
$url
.