i4w_insert_post
This hook enables you to safely run your code after a page/post has been inserted.
Parameters
Section titled “Parameters”iMember360 will pass the following parameters to your action function:
| Parameter | Description |
|---|---|
| $post_id | The post ID of the page/post being updated. |
| $post | The content of the entire $post” object. |
| $update | Determines if the action is an “insert” (false) or an “update” (true). |
Example:
Section titled “Example:”function my_i4w_insert_post($post_id, $post, $update) { // $post_id is the post ID of the page/post being updated // $post is the content of the entire $post" object // $update determines if the action is an "insert" (false) or an "update" (true)
// add your code to perform any desired action, such as sending an email notification // or changing field values in the inserted post}add_action('i4w_insert_post', 'my_i4w_insert_post', 1, 3);