WordPress Multisite below 3.7
-
The function
wp_get_sites()
is not present in WordPress versions below 3.7 so I made a modification to the functionget_blogs()
in /wp-content/plugins/wp-security-audit-log/inc/WPPHUtil.php @ Line 219.Changed:
static function get_blogs() { if(wp_is_large_network()){ return get_blog_details(get_option(WPPH_MAIN_SITE_ID_OPTION_NAME),true); } $blogs = wp_get_sites(); $out = array(); foreach($blogs as $blog){ $entry = get_blog_details($blog['blog_id']); array_push($out, array( 'blog_id' => $entry->blog_id, 'blogname' => $entry->blogname )); } array_unshift($out, array('blog_id' => 0, 'blogname' => 'All sites')); return $out; }
TO:
static function get_blogs() { global $wpdb; if(wp_is_large_network()){ return get_blog_details(get_option(WPPH_MAIN_SITE_ID_OPTION_NAME),true); } //$blogs = wp_get_sites(); $query = 'SELECT blog_id FROM ' . $wpdb->blogs; $blogs = $wpdb->get_results($query); $out = array(); foreach($blogs as $blog){ //$entry = get_blog_details($blog['blog_id']); $entry = get_blog_details($blog->blog_id); array_push($out, array( 'blog_id' => $entry->blog_id, 'blogname' => $entry->blogname )); } array_unshift($out, array('blog_id' => 0, 'blogname' => 'All sites')); return $out; }
It would be useful to see this in a future update :O)
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘WordPress Multisite below 3.7’ is closed to new replies.