wppaste
WordPress

apply_filters( 'wp_prepare_revision_for_js', array $revisions_data, WP_Post $revision, WP_Post $post )

Since
4.4.0
Filters the array of revisions used on the revisions screen.

Compatibility

WordPress
since 4.4.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$revisions_dataarray
{ The bootstrapped data for the revisions screen.
@type int $id Revision ID.
@type string $title Title for the revision's parent WP_Post object.
@type int $author Revision post author ID.
@type string $date Date the revision was modified.
@type string $dateShort Short-form version of the date the revision was modified.
@type string $timeAgo GMT-aware amount of time ago the revision was modified.
@type bool $autosave Whether the revision is an autosave.
@type bool $current Whether the revision is both not an autosave and the post modified date matches the revision modified date (GMT-aware).
@type bool|false $restoreUrl URL if the revision can be restored, false otherwise.
}
  • $idint

    Revision ID.
  • $titlestring

    Title for the revision's parent WP_Post object.
  • $authorint

    Revision post author ID.
  • $datestring

    Date the revision was modified.
  • $dateShortstring

    Short-form version of the date the revision was modified.
  • $timeAgostring

    GMT-aware amount of time ago the revision was modified.
  • $autosavebool

    Whether the revision is an autosave.
  • $currentbool

    Whether the revision is both not an autosave and the post modified date matches the revision modified date (GMT-aware).
  • $restoreUrlbool|false

    URL if the revision can be restored, false otherwise.
$revisionWP_Post
The revision's WP_Post object.
$postWP_Post
The revision's parent WP_Post object.

Where this hook fires · 1

  • wp-admin/includes/revision.php:282wp_prepare_revisions_for_js()

Source code

		 *                                  modified date matches the revision modified date (GMT-aware).		 *     @type bool|false $restoreUrl URL if the revision can be restored, false otherwise.		 * }		 * @param WP_Post $revision       The revision's WP_Post object.		 * @param WP_Post $post           The revision's parent WP_Post object.		 */		$revisions[ $revision->ID ] = apply_filters( 'wp_prepare_revision_for_js', $revisions_data, $revision, $post );	} 	/*	 * If we only have one revision, the initial revision is missing. This happens	 * when we have an autosave and the user has clicked 'View the Autosave'.	 */

Changelog

Introduced in 4.4.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.7.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.