pre_post_update

Fires immediately before an existing post is updated in the database.

Description

do_action( 'pre_post_update', (int) $post_id, (array) $data ); 

Parameters (2)

0. $post_id (int)
The post id.
1. $data (array)
Array of unslashed post data.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'pre_post_update', $post_id, $data ); 
The following example is for adding a hook callback.
  1. // define the pre_post_update callback 
  2. function action_pre_post_update( $post_id, $data ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( 'pre_post_update', 'action_pre_post_update', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'pre_post_update', 'action_pre_post_update', 10, 2 ); 

Defined (1)

The action is defined in the following location(s).

/wp-includes/post.php  
  1. do_action( 'pre_post_update', $post_ID, $data );