wphooks.info - wp_prepare_revision_for_js

wp_prepare_revision_for_js

(trunk - 5.1-alpha-44286)

The hook occurs in the following file:

wp-admin/includes/revision.php:
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
		 *     @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.
		 * }
		 * @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 autsosave and the user has clicked 'View the Autosave'
	 */
	if ( 1 === sizeof( $revisions ) ) {
		$revisions[ $post->ID ] = array(
			'id'         => $post->ID,