| 3267 | * Checks either current site or a supplied site ID against the defined main site ID |
| 3268 | * to determine if this is the main network. |
| 3269 | * |
| 3270 | * @since 3.7.0 |
| 3271 | * @package WordPress |
| 3272 | * |
| 3273 | * @param string $site_id optional site id to test (default current site) |
| 3274 | * |
| 3275 | * @return bool True if not multisite, if SITE_ID_CURRENT_SITE is not defined, or if $site_id is the main network |
| 3276 | */ |
| 3277 | function is_main_network( $site_id = '' ) { |
| 3278 | global $current_site; |
| 3279 | |
| 3280 | if ( ! is_multisite() ) |
| 3281 | return true; |
| 3282 | |
| 3283 | if ( ! defined( 'SITE_ID_CURRENT_SITE' ) ) |
| 3284 | return true; |
| 3285 | |
| 3286 | if ( ! $site_id ) |
| 3287 | $site_id = $current_site->id; |
| 3288 | |
| 3289 | return SITE_ID_CURRENT_SITE == $site_id; |
| 3290 | } |
| 3291 | |
| 3292 | /** |