Created
April 5, 2016 18:03
-
-
Save kellenmace/99a0d1a3488ab800dc705ed22f1883b1 to your computer and use it in GitHub Desktop.
Get the 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 ID of the main site in a multisite network | |
* | |
* @return int The blog_id of the main site | |
*/ | |
function km_get_main_site_id() { | |
global $current_site; | |
return $current_site->blog_id; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment