Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_prepare_revision_for_js

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
262            *     @type string     $timeAgo    GMT-aware amount of time ago the revision was modified.
263            *     @type bool       $autosave   Whether the revision is an autosave.
264            *     @type bool       $current    Whether the revision is both not an autosave and the post
265            *                                  modified date matches the revision modified date (GMT-aware).
266            *     @type bool|false $restoreUrl URL if the revision can be restored, false otherwise.
267            * }
268            * @param WP_Post $revision       The revision's WP_Post object.
269            * @param WP_Post $post           The revision's parent WP_Post object.
270            */
271           $revisions[ $revision->ID ] = apply_filters( 'wp_prepare_revision_for_js', $revisions_data, $revision, $post );
272      }
274      /**
275       * If we only have one revision, the initial revision is missing; This happens
276       * when we have an autsosave and the user has clicked 'View the Autosave'
277       */
278      if ( 1 === count( $revisions ) ) {
279           $revisions[ $post->ID ] = array(
280                'id'         => $post->ID,