WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

WPMU Functions/get most active blogs


This function has been deprecated. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. All code that uses this function should be converted to use its replacement if one exists. See also wp-includes/deprecated.php. Use any of these functions instead.

Contents

Description

Returns an array of arrays containing basic information about the most recently updated blogs on this WPMU install.

Parameters

$num
(integer) (optional) Number of most active blogs to return
Default: 10
$display
(boolean) (optional) Show the blogs as a list
Default: true

Return Values

(array) 
Returns an array of arrays each representing an active blog, ordered by number of recently posted posts (most active first). Details are represented in the following format:
blog_id 
(integer) ID of blog detailed.
domain 
(string) Domain used to access this blog.
path 
(string) Path used to access this blog.

Usage

<?php get_most_active_blogs( ); ?>

Examples

<?php
$blogs 
get_most_active_blogs(10false);
if( 
is_array$blogs ) ) {
        
?>
        <h2>Most Active Blogs</h2>
        <ul>
        <?php foreach( $blogs as $details ) {
                
?><li><a href=\"http://<?php echo $details'domain' ] . $details'path' ?>\"><?php echo get_blog_option$details'blog_id' ], 'blogname' ?></a></li><?php
        
}
        
?>
        </ul>
        <?php
}
?>

Notes

This function does not return the date each blog was updated. Unlike get_blog_list() this function does not return the post count of each blog in the array. There is no option to change the order of the returned blogs through this function.

Change Log

  • Since: MU
  • Deprecated: 3.0.0
  • No alternative available. For performance reasons this function is not recommended.