Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_blogaddress_by_domain [ WordPress Function ]

get_blogaddress_by_domain ( $domain, $path )
Parameters:
  • (string) $domain
  • (string) $path
Returns:
  • (string)
Defined at:



Get a full blog URL, given a domain and a path.

Source


<?php
function get_blogaddress_by_domain$domain$path ) {
    if ( 
is_subdomain_install() ) {
        
$url "http://" $domain.$path;
    } else {
        if ( 
$domain != $_SERVER['HTTP_HOST'] ) {
            
$blogname substr$domain0strpos$domain'.' ) );
            
$url 'http://' substr$domainstrpos$domain'.' ) + ) . $path;
            
// we're not installing the main blog
            
if ( $blogname != 'www.' )
                
$url .= $blogname '/';
        } else { 
// main blog
            
$url 'http://' $domain $path;
        }
    }
    return 
esc_url$url );
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics