the_preview
Filters the single post for preview mode.
Usage
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.
Changelog
Since 2.7.0 | Introduced. |
Where the hook is called
the_preview
wp-includes/class-wp-query.php 3467
$this->posts[0] = get_post( apply_filters_ref_array( 'the_preview', array( $this->posts[0], &$this ) ) );
Where the hook is used in WordPress
wp-includes/revision.php 899
add_filter( 'the_preview', '_set_preview' );