Changeset 16987
- Timestamp:
- 12/16/2010 07:58:57 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/ms-blogs.php
r16938 r16987 31 31 * 32 32 * @param int $blog_id Blog ID 33 * @param string $scheme Optional. Scheme to give the URL. Currently 'http', 'https' 33 34 * @return string 34 35 */ 35 function get_blogaddress_by_id( $blog_id ) { 36 function get_blogaddress_by_id( $blog_id, $scheme = null ) { 37 if ( ! in_array( $scheme, array( 'http', 'https' ) ) ) 38 $scheme = is_ssl() ? 'https' : 'http'; 39 36 40 $bloginfo = get_blog_details( (int) $blog_id, false ); // only get bare details! 37 return esc_url( 'http://'. $bloginfo->domain . $bloginfo->path );41 return esc_url( "$scheme://" . $bloginfo->domain . $bloginfo->path ); 38 42 } 39 43 … … 68 72 * @param string $domain 69 73 * @param string $path 74 * @param string $scheme Optional. Scheme to give the URL. Currently 'http', 'https' 70 75 * @return string 71 76 */ 72 function get_blogaddress_by_domain( $domain, $path ) { 77 function get_blogaddress_by_domain( $domain, $path, $scheme = null ) { 78 if ( ! in_array( $scheme, array( 'http', 'https' ) ) ) 79 $scheme = is_ssl() ? 'https' : 'http'; 80 73 81 if ( is_subdomain_install() ) { 74 $url = " http://".$domain.$path;82 $url = "$scheme://" . $domain.$path; 75 83 } else { 76 84 if ( $domain != $_SERVER['HTTP_HOST'] ) { 77 85 $blogname = substr( $domain, 0, strpos( $domain, '.' ) ); 78 $url = 'http://'. substr( $domain, strpos( $domain, '.' ) + 1 ) . $path;86 $url = "$scheme://" . substr( $domain, strpos( $domain, '.' ) + 1 ) . $path; 79 87 // we're not installing the main blog 80 88 if ( $blogname != 'www.' ) 81 89 $url .= $blogname . '/'; 82 90 } else { // main blog 83 $url = 'http://'. $domain . $path;91 $url = "$scheme://" . $domain . $path; 84 92 } 85 93 }
Note: See TracChangeset
for help on using the changeset viewer.