You appear to be a bot. Output may be restricted
Description
List blogs in a WordPress MultiSite environmentThis reinstates part of the deprecated get_blog_list() function for use with oik-ms Notes:
- oik-ms should only be installed in a WPMS environment where you are happy for other sites and their content to be accessed
- There is no security in this code over and above the existing WordPress MS security
- DON'T use this function in a large WPMS installation as the list can be very large
Usage
$mixed = bw_get_blog_list();
Parameters
Returns
mixed array of arrays [ "blog_id"Source
File name: oik-ms/shortcodes/oik-blogs.phpLines:
1 to 11 of 11
function bw_get_blog_list() { global $wpdb; $blogs = array(); $results = $wpdb->get_results( $wpdb->prepare("SELECT blog_id FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY blog_id ASC", $wpdb->siteid), ARRAY_A ); foreach ( $results as $key => $data ) { $blog_id = $data['blog_id']; $blogs[$blog_id ] = $blog_id; } bw_trace2( $blogs, "blogs" ); return( $blogs ); }View on GitHub