Make WordPress Core

Ticket #25235: 25235.diff

File 25235.diff, 2.0 KB (added by jeremyfelt, 13 years ago)
  • src/wp-includes/ms-blogs.php

     
    5656}
    5757
    5858/**
    59  * Get a full blog URL, given a domain and a path.
    60  *
    61  * @since MU
    62  *
    63  * @param string $domain
    64  * @param string $path
    65  * @return string
    66  */
    67 function get_blogaddress_by_domain( $domain, $path ) {
    68         if ( is_subdomain_install() ) {
    69                 $url = "http://" . $domain.$path;
    70         } else {
    71                 if ( $domain != $_SERVER['HTTP_HOST'] ) {
    72                         $blogname = substr( $domain, 0, strpos( $domain, '.' ) );
    73                         $url = 'http://' . substr( $domain, strpos( $domain, '.' ) + 1 ) . $path;
    74                         // we're not installing the main blog
    75                         if ( $blogname != 'www.' )
    76                                 $url .= $blogname . '/';
    77                 } else { // main blog
    78                         $url = 'http://' . $domain . $path;
    79                 }
    80         }
    81         return esc_url_raw( $url );
    82 }
    83 
    84 /**
    8559 * Given a blog's (subdomain or directory) slug, retrieve its id.
    8660 *
    8761 * @since MU
  • src/wp-includes/deprecated.php

     
    33783378
    33793379        return $size . $unit;
    33803380}
     3381
     3382/**
     3383 * Get a full blog URL, given a domain and a path.
     3384 *
     3385 * @since MU
     3386 * @deprecated 3.7.0
     3387 *
     3388 * @param string $domain
     3389 * @param string $path
     3390 * @return string
     3391 */
     3392function get_blogaddress_by_domain( $domain, $path ) {
     3393        _deprecated_function( __FUNCTION__, '3.7' );
     3394
     3395        if ( is_subdomain_install() ) {
     3396                $url = "http://" . $domain.$path;
     3397        } else {
     3398                if ( $domain != $_SERVER['HTTP_HOST'] ) {
     3399                        $blogname = substr( $domain, 0, strpos( $domain, '.' ) );
     3400                        $url = 'http://' . substr( $domain, strpos( $domain, '.' ) + 1 ) . $path;
     3401                        // we're not installing the main blog
     3402                        if ( $blogname != 'www.' )
     3403                                $url .= $blogname . '/';
     3404                } else { // main blog
     3405                        $url = 'http://' . $domain . $path;
     3406                }
     3407        }
     3408        return esc_url_raw( $url );
     3409}