wp_restore_post_revision
Action HookDescription
Fires after a post revision has been restored.Hook Information
File Location |
wp-includes/revision.php
View on GitHub
|
Hook Type | Action |
Line Number | 503 |
Hook Parameters
Type | Name | Description |
---|---|---|
int
|
$post_id
|
Post ID. |
int
|
$revision_id
|
Post revision ID. |
Usage Examples
Basic Usage
<?php
// Hook into wp_restore_post_revision
add_action('wp_restore_post_revision', 'my_custom_function', 10, 2);
function my_custom_function($post_id, $revision_id) {
// Your custom code here
}
Source Code Context
wp-includes/revision.php:503
- How this hook is used in WordPress core
<?php
498 * @since 2.6.0
499 *
500 * @param int $post_id Post ID.
501 * @param int $revision_id Post revision ID.
502 */
503 do_action( 'wp_restore_post_revision', $post_id, $revision['ID'] );
504
505 return $post_id;
506 }
507
508 /**
PHP Documentation
<?php
/**
* Fires after a post revision has been restored.
*
* @since 2.6.0
*
* @param int $post_id Post ID.
* @param int $revision_id Post revision ID.
*/
Quick Info
- Hook Type: Action
- Parameters: 2
- File: wp-includes/revision.php
Related Hooks
Related hooks will be displayed here in future updates.