Domain Mapping, User Management, and get_site_url vs. get_blogaddress_by_*
-
Is there any reason that wp-activate.php uses get_blogaddress_by_id() to fetch the URL of a multi-site blog? Line 98, wordpress/wp-activate.php.
Most areas in WordPress that need to get a site URL will get it using get_site_url() – from wordpress/wp-includes/link-template.php.
If you have the blog_id, you could switch to the blog in question, and get the URL with get_site_url(). Or even, call:
$url = get_site_url($blog_id);
The reason I ask is that get_site_url passes the result to a filter, which allows plugins to manipulate the “home page” of a blog. Anyone who uses a domain mapping plugin for their child sites (https://www.ads-software.com/plugins/wordpress-mu-domain-mapping/) does not want their home URL to be https://basesite.com/fakechildpath, but rather https://childsite.com.
This in itself isn’t a huge problem, as https://basesite.com/fakechildpath will eventually map to the right place, but it doesn’t look nice.
The real problem occurs when you combine a domain mapping plugin with a WordPress security plugin (which forces users to login with a security argument in the querystring which is checked in the Referrer). Here, you’d want to rewrite any request for get_site_url with path=’wp-login.php’ to contain the additional querystring.
Not having the ability to do this is forcing me to modify WP Core, which will just get clobbered the next time I update WordPress.
Is this the proper forum to introduce changes to WP Core, or should I just fork and submit a pull request somewhere?
- The topic ‘Domain Mapping, User Management, and get_site_url vs. get_blogaddress_by_*’ is closed to new replies.