the_preview хук-фильтрWP 2.7.0

Filters the single post for preview mode.

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

add_filter( 'the_preview', 'wp_kama_the_preview_filter' );

/**
 * Function for `the_preview` filter-hook.
 * 
 * @param WP_Post $post_preview The Post object.
 *
 * @return WP_Post
 */
function wp_kama_the_preview_filter( $post_preview ){

	// filter...
	return $post_preview;
}
$post_preview(WP_Post)
The Post object.

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

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

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

WP_Query::get_posts()
the_preview
wp-includes/class-wp-query.php 3557
$this->posts[0] = get_post( apply_filters_ref_array( 'the_preview', array( $this->posts[0], &$this ) ) );

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

wp-includes/revision.php 891
add_filter( 'the_preview', '_set_preview' );