get_last_updated()获取最近更新的博客(多站点)

目录

描述

Get a list of most recently updated blogs.

get_last_updated() 描述

用法

<?php get_last_updated$deprecated$start$quantity ?>

get_last_updated() 用法

参数

$deprecated

(mixed) (可选) Not used

默认值: empty string

$start

(integer) (可选) The offset

默认值: 0

$quantity

(integer) (可选) The maximum number of blogs to retrieve.

默认值: 40

get_last_updated() 参数

返回值

(array

The list of blogs

get_last_updated() 返回值

示例

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */

get_last_updated() 示例

注意

The $start offset specifies how many recent blogs to skip over. This is useful for pagination.

get_last_updated() 注意

历史

添加于 版本: 3.0.0

get_last_updated() 历史

源文件

get_last_updated() 函数的代码位于 wp-includes/ms-blogs.php

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */
/**
 * Get a list of most recently updated blogs.
 *
 * @since MU
 *
 * @global wpdb $wpdb
 *
 * @param mixed $deprecated Not used
 * @param int   $start      The offset
 * @param int   $quantity   The maximum number of blogs to retrieve. Default is 40.
 * @return array The list of blogs
 */
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", $wpdb->siteid, $start, $quantity ) , ARRAY_A );
}

get_last_updated() 源文件

相关