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