acf_save_post_revision()ACF 5.4.0

acf_save_post_revision

This function will copy meta from a post to it's latest revision

No Hooks.

Returns

null. Nothing (null).

Usage

acf_save_post_revision( $post_id );
$post_id
.

Changelog

Since 5.4.0 Introduced.

acf_save_post_revision() code ACF 6.0.4

function acf_save_post_revision( $post_id = 0 ) {

	// get latest revision
	$revision = acf_get_post_latest_revision( $post_id );

	// save
	if ( $revision ) {

		acf_copy_postmeta( $post_id, $revision->ID );

	}

}