get_last_updated

函数
get_last_updated ( $deprecated = '', $start = 0, $quantity = 40 )
参数
  • (mixed) $deprecated Not used.
    Required:
    Default: (empty)
  • (int) $start Optional. Number of blogs to offset the query. Used to build LIMIT clause. Can be used for pagination. Default 0.
    Required:
  • (int) $quantity Optional. The maximum number of blogs to retrieve. Default 40.
    Required:
    Default: 40
返回值
  • (array) The list of blogs.
定义位置
相关方法
get_lastpostdateget_theme_updatesget_plugin_updatesget_the_dateget_core_updates
引入
-
弃用
-

get_last_updated: 这个函数用来检索最近的文章或页面被更新的日期和时间。

获得最近更新的博客列表。

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 );
}

常见问题

FAQs
查看更多 >