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.
}$idintRevision ID.$titlestringTitle for the revision's parent WP_Post object.$authorintRevision post author ID.$datestringDate the revision was modified.$dateShortstringShort-form version of the date the revision was modified.$timeAgostringGMT-aware amount of time ago the revision was modified.$autosaveboolWhether the revision is an autosave.$currentboolWhether the revision is both not an autosave and the post modified date matches the revision modified date (GMT-aware).$restoreUrlbool|falseURL 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.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.9.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.