Switch language

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




is_main_site [ WordPress Function ]

is_main_site ( $blog_id = '' )
Parameters:
  • (int) $blog_id optional blog id to test (default current blog)
Returns:
  • (bool) True if not multisite or $blog_id is main site
Defined at:



Is main site?

Source


<?php
function is_main_site$blog_id '' ) {
    global 
$current_site$current_blog;

    if ( !
is_multisite() )
        return 
true;

    if ( !
$blog_id )
        
$blog_id $current_blog->blog_id;

    return 
$blog_id == $current_site->blog_id;
}
?>

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