wp_prepare_revision_for_js WordPress Filter Hook

wp_prepare_revision_for_js is a Wordpress hook that is triggered when a revision is being prepared for JavaScript. This hook is used to add data to a revision that will be used by JavaScript.

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

Filters the array of revisions used on the revisions screen.


Parameters

$revisions_data

(array)The bootstrapped data for the revisions screen.

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

$revision

(WP_Post)The revision's WP_Post object.

$post

(WP_Post)The revision's parent WP_Post object.


Top ↑

Source

File: wp-admin/includes/revision.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.