Make WordPress Core

Changeset 25276


Ignore:
Timestamp:
09/06/2013 11:40:58 AM (11 years ago)
Author:
SergeyBiryukov
Message:

Deprecate get_blogaddress_by_domain(), unused since [25261]. props jeremyfelt. fixes #25235.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-blogs.php

    r25033 r25276  
    5454    }
    5555    return esc_url( $url . '/' );
    56 }
    57 
    58 /**
    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 );
    8256}
    8357
  • trunk/src/wp-includes/ms-deprecated.php

    r24993 r25276  
    317317    return 0;
    318318}
     319
     320/**
     321 * Get a full blog URL, given a domain and a path.
     322 *
     323 * @since MU
     324 * @deprecated 3.7.0
     325 *
     326 * @param string $domain
     327 * @param string $path
     328 * @return string
     329 */
     330function get_blogaddress_by_domain( $domain, $path ) {
     331    _deprecated_function( __FUNCTION__, '3.7' );
     332
     333    if ( is_subdomain_install() ) {
     334        $url = "http://" . $domain.$path;
     335    } else {
     336        if ( $domain != $_SERVER['HTTP_HOST'] ) {
     337            $blogname = substr( $domain, 0, strpos( $domain, '.' ) );
     338            $url = 'http://' . substr( $domain, strpos( $domain, '.' ) + 1 ) . $path;
     339            // we're not installing the main blog
     340            if ( $blogname != 'www.' )
     341                $url .= $blogname . '/';
     342        } else { // main blog
     343            $url = 'http://' . $domain . $path;
     344        }
     345    }
     346    return esc_url_raw( $url );
     347}
Note: See TracChangeset for help on using the changeset viewer.