wp_save_revisioned_meta_fields()
Save the revisioned meta fields.
Хуков нет.
Возвращает
null. Ничего (null).
Использование
wp_save_revisioned_meta_fields( $revision_id, $post_id );
- $revision_id(int) (обязательный)
- The ID of the revision to save the meta to.
- $post_id(int) (обязательный)
- The ID of the post the revision is associated with.
Список изменений
| С версии 6.4.0 | Введена. |
Код wp_save_revisioned_meta_fields() wp save revisioned meta fields WP 7.1.3
function wp_save_revisioned_meta_fields( $revision_id, $post_id ) {
$post_type = get_post_type( $post_id );
if ( ! $post_type ) {
return;
}
foreach ( wp_post_revision_meta_keys( $post_type ) as $meta_key ) {
if ( metadata_exists( 'post', $post_id, $meta_key ) ) {
_wp_copy_post_meta( $post_id, $revision_id, $meta_key );
}
}
}