WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/08/2010 01:00:09 PM (11 years ago)
Author:
ryan
Message:

Deprecate get_most_active_blogs() and get_blog_list(). Props ocean90. fixes #13773

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-blogs.php

    r14703 r15168  
    540540}
    541541
    542 function get_blog_list( $start = 0, $num = 10, $deprecated = '' ) {
    543     global $wpdb;
    544 
    545     $blogs = get_site_option( "blog_list" );
    546     $update = false;
    547     if ( is_array( $blogs ) ) {
    548         if ( ( $blogs['time'] + 60 ) < time() ) { // cache for 60 seconds.
    549             $update = true;
    550         }
    551     } else {
    552         $update = true;
    553     }
    554 
    555     if ( $update == true ) {
    556         unset( $blogs );
    557         $blogs = $wpdb->get_results( $wpdb->prepare("SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY registered DESC", $wpdb->siteid), ARRAY_A );
    558 
    559         foreach ( (array) $blogs as $details ) {
    560             $blog_list[ $details['blog_id'] ] = $details;
    561             $blog_list[ $details['blog_id'] ]['postcount'] = $wpdb->get_var( "SELECT COUNT(ID) FROM " . $wpdb->base_prefix . $details['blog_id'] . "_posts WHERE post_status='publish' AND post_type='post'" );
    562         }
    563         unset( $blogs );
    564         $blogs = $blog_list;
    565         update_site_option( "blog_list", $blogs );
    566     }
    567 
    568     if ( false == is_array( $blogs ) )
    569         return array();
    570 
    571     if ( $num == 'all' )
    572         return array_slice( $blogs, $start, count( $blogs ) );
    573     else
    574         return array_slice( $blogs, $start, $num );
    575 }
    576 
    577542?>
Note: See TracChangeset for help on using the changeset viewer.