wpseek.com
WordPress开发者和主题制作者的搜索引擎
wp_restore_post_revision_meta › WordPress Function
Since6.4.0
已弃用n/a
› wp_restore_post_revision_meta ( $post_id, $revision_id )
参数: (2) |
|
定义在: |
|
文档: |
Restore the revisioned meta values for a post.
源码
function wp_restore_post_revision_meta( $post_id, $revision_id ) { $post_type = get_post_type( $post_id ); if ( ! $post_type ) { return; } // Restore revisioned meta fields. foreach ( wp_post_revision_meta_keys( $post_type ) as $meta_key ) { // Clear any existing meta. delete_post_meta( $post_id, $meta_key ); _wp_copy_post_meta( $revision_id, $post_id, $meta_key ); } }