rest_api_inserted_post

The Jetpack by WordPress.com rest api inserted post hook.

Description

do_action( 'rest_api_inserted_post', (unknown) $post_id, (unknown) $insert, (unknown) $new ); 

Parameters (3)

0. $post_id (unknown)
The post id.
1. $insert (unknown)
The insert.
2. $new (unknown)
The new.

Usage

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

Defined (3)

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

/json-endpoints/class.wpcom-json-api-update-post-v1-2-endpoint.php  
  1. do_action( 'rest_api_inserted_post', $post_id, $insert, $new ); 
/json-endpoints/class.wpcom-json-api-update-post-v1-1-endpoint.php  
  1. do_action( 'rest_api_inserted_post', $post_id, $insert, $new ); 
/json-endpoints/class.wpcom-json-api-update-post-endpoint.php  
  1. do_action( 'rest_api_inserted_post', $post_id, $insert, $new );