wpseek.com
A WordPress-centric search engine for devs and theme authors
_set_preview is private and should not be used in themes or plugins directly.
_set_preview › WordPress Function
Since2.7.0
Deprecatedn/a
› _set_preview ( $post )
Access: |
|
Parameters: |
|
Returns: |
|
Defined at: |
|
Codex: |
Sets up the post object for preview based on the post autosave.
Related Functions: post_preview, is_preview, _show_post_preview, wp_post_preview_js, stream_preview_image
Source
function _set_preview( $post ) { if ( ! is_object( $post ) ) { return $post; } $preview = wp_get_post_autosave( $post->ID ); if ( is_object( $preview ) ) { $preview = sanitize_post( $preview ); $post->post_content = $preview->post_content; $post->post_title = $preview->post_title; $post->post_excerpt = $preview->post_excerpt; } add_filter( 'get_the_terms', '_wp_preview_terms_filter', 10, 3 ); add_filter( 'get_post_metadata', '_wp_preview_post_thumbnail_filter', 10, 3 ); add_filter( 'get_post_metadata', '_wp_preview_meta_filter', 10, 4 ); return $post; }