pre_post_update
Fires immediately before an existing post is updated in the database.
Description
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.
- // run the action
- do_action( 'pre_post_update', $post_id, $data );
- The following example is for adding a hook callback.
- // define the pre_post_update callback
- function action_pre_post_update( $post_id, $data ) {
- // make action magic happen here...
- };
- // add the action
- add_action( 'pre_post_update', 'action_pre_post_update', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the action
- 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
- do_action( 'pre_post_update', $post_ID, $data );