• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress core a2z

WordPress core a2z

WordPress core only

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / is_main_network() – Determine whether a network is the main network of the Multisite installation.

You appear to be a bot. Output may be restricted

Description

Determine whether a network is the main network of the Multisite installation.

Usage

$bool = is_main_network( $network_id );

Parameters

$network_id
( int ) optional – Optional. Network ID to test. Defaults to current network.

Returns

bool True if $network_id is the main network, or if not running Multisite.

Source

File name: wordpress/wp-includes/functions.php
Lines:

1 to 13 of 13
function is_main_network( $network_id = null ) {
  if ( ! is_multisite() ) {
    return true;
  }

  if ( null === $network_id ) {
    $network_id = get_current_network_id();
  }

  $network_id = (int) $network_id;

  return ( get_main_network_id() === $network_id );
}
 

 View on GitHub View on Trac

Published: 25th November 2019 | Last updated: 2nd April 2020

Primary Sidebar

Information

Function name: is_main_network
Plugin ref: WordPress
Version: 5.7.1
Sourcefile: wp-includes/functions.php
File ref: wp-includes/functions.php
Deprecated?: No
API Letters: I,M,N

Footer

WP-a2z
WordPress core a2z
WordPress core only
WordPress 5.7.1
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  core.wp-a2z.org
© Copyright WP-a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites