wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema
wp_restore_post_revision_meta › WordPress Function
Desde6.4.0
Obsoleton/a
› wp_restore_post_revision_meta ( $post_id, $revision_id )
| Parâmetros: (2) |
|
| Definido em: |
|
| Codex: |
Restore the revisioned meta values for a post.
Funções relacionadas: wp_restore_post_revision, wp_get_post_revision, wp_delete_post_revision, wp_get_post_revisions, wp_post_revision_meta_keys
Fonte
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 );
}
}