improvements to get_home/site_url, props andreasnrb + code cleanup, see #12735

git-svn-id: http://svn.automattic.com/wordpress/trunk@14702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
wpmuguru 2010-05-16 21:58:31 +00:00
parent bd467ad036
commit 021179162a
1 changed files with 13 additions and 13 deletions

View File

@ -1852,7 +1852,7 @@ function get_home_url( $blog_id = null, $path = '', $scheme = null ) {
if ( empty( $blog_id ) || !is_multisite() )
$home = get_option( 'home' );
else
$home = untrailingslashit(get_blogaddress_by_id($blog_id));
$home = get_blog_option( $blog_id, 'home' );
$url = str_replace( 'http://', "$scheme://", $home );
@ -1903,7 +1903,7 @@ function get_site_url( $blog_id = null, $path = '', $scheme = null ) {
if ( !in_array( $scheme, array( 'http', 'https' ) ) ) {
if ( ( 'login_post' == $scheme || 'rpc' == $scheme ) && ( force_ssl_login() || force_ssl_admin() ) )
$scheme = 'https';
elseif ( ('login' == $scheme) && ( force_ssl_admin() ) )
elseif ( ( 'login' == $scheme ) && force_ssl_admin() )
$scheme = 'https';
elseif ( ( 'admin' == $scheme ) && force_ssl_admin() )
$scheme = 'https';
@ -1914,7 +1914,7 @@ function get_site_url( $blog_id = null, $path = '', $scheme = null ) {
if ( empty( $blog_id ) || !is_multisite() )
$url = get_option( 'siteurl' );
else
$url = untrailingslashit(get_blogaddress_by_id($blog_id));
$url = get_blog_option( $blog_id, 'siteurl' );
$url = str_replace( 'http://', "{$scheme}://", $url );