update_postmeta_cache()WP 2.1.0

Updates metadata cache for a list of post IDs.

Performs SQL query to retrieve the metadata for the post IDs and updates the metadata cache for the posts. Therefore, the functions, which call this function, do not need to perform SQL queries on their own.

Хуков нет.

Возвращает

Массив|false. An array of metadata on success, false if there is nothing to update.

Использование

update_postmeta_cache( $post_ids );
$post_ids(int[]) (обязательный)
Array of post IDs.

Список изменений

С версии 2.1.0 Введена.

Код update_postmeta_cache() WP 6.5.2

function update_postmeta_cache( $post_ids ) {
	return update_meta_cache( 'post', $post_ids );
}