Skip to content

wpuf_add_post_after_insert

wpuf_add_post_after_insert

This hook runs after a new post is created, all the custom taxonomies and post meta are saved.

Accepts 4 parameters:

  1. $post_id – integer
  2. $form_id – integer
  3. $form_settings – array
  4. $form_vars – array

You can run any code, may be save some custom fields or run some special events when a new post is created.

function wpufe_update_post_price( $post_id ) {$price = get_post_meta( $post_id, '_price', true );

update_post_meta( $post_id, '_regular_price', $price );
}

add_action( 'wpuf_add_post_after_insert', 'wpufe_update_post_price' );

When our new post is created, we are retrieving a custom field _price from the post and saving it again as _regular_price.

When updating a post, use wpuf_edit_post_after_update hook.

WAIT! Don’t Miss Our Biggest Sale of the Year!

BlackFriday

EarlyDeals

Save Up To

81%

on weDevs Products

Hurry! This massive deal disappears when the timer runs out.

00Days00Hour00Min00Sec
Claim Yours & Save Up To 81%