WordPress.org

Codex

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

WPMU Functions/get last updated

Description

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

Parameters

$deprecated
(string) (optional) Deprecated.
Default: [blank string]
$start
(integer) (optional) The first blog to return in the array.
Default: 0
$quantity
(integer) (optional) The number of blogs to return in the array (thus the size of the array).
Default: 40

Return Values

(array) 
Returns an array of arrays each representing a recently updated blog, ordered by updated date (most recent 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_last_updated( ); ?> <?php get_last_updated(' '010); // gets the last 10 updated blogs ?>

Examples

<?php
   $blogs = get_last_updated();
   echo 'Last updated blog IDs:<ul>';
   foreach ($blogs AS $blog) {
      echo '<li>'.$blog['blog_id'].'</li>';
   }
   echo '</ul>';
?>
<?php $blogs = get_last_updated(); ?>          
<?php if (is_array($blogs)) : ?>

   <h2>Last updated:</h2>

   <ul>

      <?php foreach($blogs as $blog) : ?>
      		    
         <li><a href="http://<?php echo $blog[ 'domain' ] . $blog[ 'path' ] ?>"><?php echo get_blog_option( $blog[ 'blog_id' ], 'blogname' ) ?></a></li>

      <?php endforeach; // blogs as blog ?>

   </ul>
        
<?php endif; ?>

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.