Last active
December 15, 2015 18:59
-
-
Save ShaneGowland/5307453 to your computer and use it in GitHub Desktop.
Allows you to display the total number of sites on a WordPress Network. Pluginified.
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
function get_site_count(){ | |
global $wpdb; | |
$id = 0; | |
$site_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM wp_blogs WHERE deleted = %d",$id)); | |
return $site_count; | |
} | |
//register the shortcode | |
add_shortcode('sitecount', 'get_site_count'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment