wp_restore_footnotes_from_revision

The timeline below displays how wordpress function wp_restore_footnotes_from_revision has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

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');
    }
}

WordPress Version: 6.3

/**
 * 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', $footnotes);
    } else {
        delete_post_meta($post_id, 'footnotes');
    }
}