Forked from kellenmace/get-id-of-main-site-in-wordpress-multisite.php
Created
November 4, 2018 03:51
-
-
Save harimau99/7e49703141e701b5b642773e071ad4b5 to your computer and use it in GitHub Desktop.
Get the Blog ID of the Main Site in a WordPress Multisite Network
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Get the Blog ID of the main site in a multisite network. | |
* | |
* @return int The blog_id of the main site. | |
*/ | |
function km_get_main_site_blog_id() { | |
return get_network()->site_id; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment