Answer the question
In order to leave comments, you need to log in
How to get custom fields from a revision?
Good day, I can’t make friends getting custom fields from revisions of custom post types (yes, they are registered and they have revisions), I tried different options, and through wp_get_post_revisions and through get_children , displaying a list of revisions for a post was no problem, but getting an arbitrary the field from the revision is the whole problem.
<?
$get_meta_revs = wp_get_post_revisions( $id_obj );
foreach ( $get_meta_revs as $get_meta_rev ) { ?>
<? echo $get_meta_rev->ID; ?>
<? echo get_field( 'phone1', $get_meta_rev->ID );?>
<?}?>
<?
$get_meta_revs = get_children( array(
'post_parent' => $id_obj,
'post_type' => 'revision'
) );
foreach ( $get_meta_revs as $get_meta_rev ) { ?>
<? echo $get_meta_rev->ID; ?>
<? echo get_field( 'phone1', $get_meta_rev->ID );?>
<? } ?>
Answer the question
In order to leave comments, you need to log in
Read this https://wordpress.stackexchange.com/questions/2219...
And this is https://github.com/adamsilverstein/wp-post-meta-re...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question