get_last_updated

Get a list of most recently updated blogs.

Description

(array) get_last_updated( (string) $deprecated = '', (int) $start = 0, (int) $quantity = 40 ); 

Returns (array)

The list of blogs

Parameters (3)

0. $deprecated — Optional. (string) => ''
The deprecated.
1. $start — Optional. (int)
The start.
2. $quantity — Optional. (int) => 40
The maximum number of blogs to retrieve. Default is 40.

Usage

  1. if ( !function_exists( 'get_last_updated' ) ) { 
  2. require_once ABSPATH . WPINC . '/ms-blogs.php'; 
  3.  
  4. // The deprecated. 
  5. $deprecated = ''; 
  6.  
  7. // The start. 
  8. $start = -1; 
  9.  
  10. // The maximum number of blogs to retrieve. Default is 40. 
  11. $quantity = 40; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = get_last_updated($deprecated, $start, $quantity); 
  15.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/ms-blogs.php  
  1. function get_last_updated( $deprecated = '', $start = 0, $quantity = 40 ) { 
  2. global $wpdb; 
  3.  
  4. if ( ! empty( $deprecated ) ) 
  5. _deprecated_argument( __FUNCTION__, 'MU' ); // never used 
  6.  
  7. return $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' AND last_updated != '0000-00-00 00:00:00' ORDER BY last_updated DESC limit %d, %d", $wpdb->siteid, $start, $quantity ) , ARRAY_A );