Opened 9 years ago
Last modified 2 weeks ago
#37297 reviewing enhancement
Deprecate get_blogaddress_by_id function
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.9 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Networks and Sites | Keywords: | has-patch has-unit-tests commit |
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 (16)
#3
@
9 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
@
9 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.
9 years ago
#6
@
9 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.
This ticket was mentioned in Slack in #core by chriscct7. View the logs.
9 years ago
This ticket was mentioned in Slack in #core-multisite by jeremyfelt. View the logs.
9 years ago
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
9 years ago
This ticket was mentioned in Slack in #core-multisite by flixos90. View the logs.
9 years ago
#11
@
9 years ago
- Milestone changed from 4.7 to Future Release
This needs further thought and should be tested earlier in a release cycle. Let's reconsider it in one of the next releases.
This ticket was mentioned in Slack in #core-multisite by spacedmonkey. View the logs.
4 weeks ago
This ticket was mentioned in PR #8659 on WordPress/wordpress-develop by @sukhendu2002.
3 weeks ago
#14
- Keywords has-patch has-unit-tests added; needs-patch removed
…me_url()
Trac ticket: https://core.trac.wordpress.org/ticket/37297
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
.