get_last_updated() WordPress Function

The get_last_updated() function is used to retrieve the date on which a post or page was last updated. This function is useful for displaying the most recent update date for a post or page on your website.

get_last_updated( mixed $deprecated = '', int $start, int $quantity = 40 ) #

Get a list of most recently updated blogs.


Parameters

$deprecated

(mixed)(Optional)Not used.

Default value: ''

$start

(int)(Optional) Number of blogs to offset the query. Used to build LIMIT clause. Can be used for pagination. Default 0.

$quantity

(int)(Optional) The maximum number of blogs to retrieve.

Default value: 40


Top ↑

Return

(array) The list of blogs.


Top ↑

Source

File: wp-includes/ms-blogs.php

function get_last_updated( $deprecated = '', $start = 0, $quantity = 40 ) {
	global $wpdb;

	if ( ! empty( $deprecated ) ) {
		_deprecated_argument( __FUNCTION__, 'MU' ); // Never used.
	}

	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", get_current_network_id(), $start, $quantity ), ARRAY_A );
}


Top ↑

Changelog

Changelog
VersionDescription
MU (3.0.0)Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.