wp_ajax_get_revision_diffs

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

WordPress Version: 6.3

/**
 * Handles getting revision diffs via AJAX.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    $post = get_post((int) $_REQUEST['post_id']);
    if (!$post) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    $revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false));
    if (!$revisions) {
        wp_send_json_error();
    }
    $return = array();
    if (function_exists('set_time_limit')) {
        set_time_limit(0);
    }
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 6.2

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    $post = get_post((int) $_REQUEST['post_id']);
    if (!$post) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    $revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false));
    if (!$revisions) {
        wp_send_json_error();
    }
    $return = array();
    if (function_exists('set_time_limit')) {
        set_time_limit(0);
    }
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 5.3

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    $post = get_post((int) $_REQUEST['post_id']);
    if (!$post) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    $revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false));
    if (!$revisions) {
        wp_send_json_error();
    }
    $return = array();
    set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .20

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 5.2

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .10

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 4.5

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .30

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 4.3

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .20

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 4.2

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .10

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 4.4

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 3.5

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 3.4

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .30

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 3.3

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .20

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 3.2

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .10

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 4.3

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 2.9

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 2.4

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .30

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 2.3

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .20

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 2.2

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .10

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 1.5

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .40

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 1.4

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .30

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 1.3

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .20

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 1.2

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .12

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 0.4

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .30

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 0.3

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .20

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 0.2

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .12

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 4.0

/**
 * Ajax handler for getting revision diffs.
 *
 * @since 3.6.0
 */
function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 9.2

function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .13

function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 8.4

function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .30

function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 8.3

function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .20

function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 8.2

function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .15

function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 7.5

function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .40

function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 7.4

function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .30

function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 7.3

function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .20

function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 7.2

function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: .15

function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('edit_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}

WordPress Version: 3.7

function wp_ajax_get_revision_diffs()
{
    require ABSPATH . 'wp-admin/includes/revision.php';
    if (!$post = get_post((int) $_REQUEST['post_id'])) {
        wp_send_json_error();
    }
    if (!current_user_can('read_post', $post->ID)) {
        wp_send_json_error();
    }
    // Really just pre-loading the cache here.
    if (!$revisions = wp_get_post_revisions($post->ID, array('check_enabled' => false))) {
        wp_send_json_error();
    }
    $return = array();
    @set_time_limit(0);
    foreach ($_REQUEST['compare'] as $compare_key) {
        list($compare_from, $compare_to) = explode(':', $compare_key);
        // from:to
        $return[] = array('id' => $compare_key, 'fields' => wp_get_revision_ui_diff($post, $compare_from, $compare_to));
    }
    wp_send_json_success($return);
}