WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

wp_restore_post_revision() WP 2.6.0

Restores a post to the specified revision.

Can restore a past revision using all fields of the post revision, or only selected fields.

Хуки из функции
Возвращает

Число/false/null. Null if error, false if no fields to restore, (int) post ID if success.

Использование

wp_restore_post_revision( $revision_id, $fields );
$revision_id(число/WP_Post) (обязательный)
Revision ID or revision object.
$fields(массив)
What fields to restore from.
По умолчанию: all

Код wp restore post revision: wp-includes/revision.php VER 5.1.1

<?php
function wp_restore_post_revision( $revision_id, $fields = null ) {
	if ( ! $revision = wp_get_post_revision( $revision_id, ARRAY_A ) ) {
		return $revision;
	}

	if ( ! is_array( $fields ) ) {
		$fields = array_keys( _wp_post_revision_fields( $revision ) );
	}

	$update = array();
	foreach ( array_intersect( array_keys( $revision ), $fields ) as $field ) {
		$update[ $field ] = $revision[ $field ];
	}

	if ( ! $update ) {
		return false;
	}

	$update['ID'] = $revision['post_parent'];

	$update = wp_slash( $update ); //since data is from db

	$post_id = wp_update_post( $update );
	if ( ! $post_id || is_wp_error( $post_id ) ) {
		return $post_id;
	}

	// Update last edit user
	update_post_meta( $post_id, '_edit_last', get_current_user_id() );

	/**
	 * Fires after a post revision has been restored.
	 *
	 * @since 2.6.0
	 *
	 * @param int $post_id     Post ID.
	 * @param int $revision_id Post revision ID.
	 */
	do_action( 'wp_restore_post_revision', $post_id, $revision['ID'] );

	return $post_id;
}