Created
September 27, 2018 03:27
-
-
Save tradesouthwest/1ba56633492fbc4e32bad127c8f58999 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 all blog ids of blogs in the current network that are: | |
* - not archived | |
* - not spam | |
* - not deleted | |
* | |
* | |
* @return array|false The blog ids, false if no matches. | |
*/ | |
private static function get_blog_ids() { | |
global $wpdb; | |
// get an array of blog ids | |
$sql = "SELECT blog_id FROM $wpdb->blogs | |
WHERE archived = '0' AND spam = '0' | |
AND deleted = '0'"; | |
return $wpdb->get_col( $sql ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment