WordPress Version: 3.1
/**
* Restores the footnotes meta value from the revision.
*
* @since 6.3.0
*
* @param int $post_id The post ID.
* @param int $revision_id The revision ID.
*/
function wp_restore_footnotes_from_revision($post_id, $revision_id)
{
$footnotes = get_post_meta($revision_id, 'footnotes', true);
if ($footnotes) {
update_post_meta($post_id, 'footnotes', wp_slash($footnotes));
} else {
delete_post_meta($post_id, 'footnotes');
}
}