_set_preview
函数
_set_preview ( $post )
- Access
- Private
- 参数
-
-
(WP_Post)
$post- Required: 是
-
(WP_Post)
- 返回值
-
- (WP_Post|false)
- 定义位置
-
-
wp-includes/revision.php
, line 697
-
wp-includes/revision.php
- 引入
- 2.7.0
- 弃用
- –
Sets up the post object for preview based on the post autosave.
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 ); return $post; }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。