WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 270 | * @type string $timeAgo GMT-aware amount of time ago the revision was modified. |
| 271 | * @type bool $autosave Whether the revision is an autosave. |
| 272 | * @type bool $current Whether the revision is both not an autosave and the post |
| 273 | * modified date matches the revision modified date (GMT-aware). |
| 274 | * @type bool|false $restoreUrl URL if the revision can be restored, false otherwise. |
| 275 | * } |
| 276 | * @param WP_Post $revision The revision's WP_Post object. |
| 277 | * @param WP_Post $post The revision's parent WP_Post object. |
| 278 | */ |
| 279 | $revisions[ $revision->ID ] = apply_filters( 'wp_prepare_revision_for_js', $revisions_data, $revision, $post ); |
| 280 | } |
| 281 | |
| 282 | /** |
| 283 | * If we only have one revision, the initial revision is missing; This happens |
| 284 | * when we have an autsosave and the user has clicked 'View the Autosave' |
| 285 | */ |
| 286 | if ( 1 === count( $revisions ) ) { |
| 287 | $revisions[ $post->ID ] = array( |
| 288 | 'id' => $post->ID, |