関数 is_main_site()
定義ファイル :/blog/wp-includes/functions.php 18
is_main_site()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | /** * Determine whether a site is the main site of the current network. * * @since 3.0.0 * * @param int $site_id Optional. Site ID to test. Defaults to current site. * Defaults to current site. * @return bool True if $site_id is the main site of the network, or if not * running Multisite. */ function is_main_site( $site_id = null ) { // This is the current network's information; 'site' is old terminology. global $current_site; if ( ! is_multisite() ) return true; if ( ! $site_id ) $site_id = get_current_blog_id(); return (int) $site_id === (int) $current_site->blog_id; } |