pre_get_lastpostmodified хук-фильтрWP 4.4.0

Pre-filter the return value of get_lastpostmodified() before the query is run.

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

add_filter( 'pre_get_lastpostmodified', 'wp_kama_pre_get_lastpostmodified_filter', 10, 3 );

/**
 * Function for `pre_get_lastpostmodified` filter-hook.
 * 
 * @param string|false $lastpostmodified The most recent time that a post was modified, in 'Y-m-d H:i:s' format, or false. Returning anything other than false will short-circuit the function.
 * @param string       $timezone         Location to use for getting the post modified date. See get_lastpostdate() for accepted `$timezone` values.
 * @param string       $post_type        The post type to check.
 *
 * @return string|false
 */
function wp_kama_pre_get_lastpostmodified_filter( $lastpostmodified, $timezone, $post_type ){

	// filter...
	return $lastpostmodified;
}
$lastpostmodified(строка|false)
The most recent time that a post was modified, in 'Y-m-d H:i:s' format, or false. Returning anything other than false will short-circuit the function.
$timezone(строка)
Location to use for getting the post modified date. See get_lastpostdate() for accepted $timezone values.
$post_type(строка)
The post type to check.

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

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

Где вызывается хук

get_lastpostmodified()
pre_get_lastpostmodified
wp-includes/post.php 7208
$lastpostmodified = apply_filters( 'pre_get_lastpostmodified', false, $timezone, $post_type );

Где используется хук в WordPress

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