wpuf_edit_post_after_update
A- A+
wpuf_edit_post_after_update
This hook runs after a post has been updated, all the custom taxonomies and post meta are saved.
Parameters
Accepts 4 parameters:
- $post_id – integer
- $form_id – integer
- $form_settings – array
- $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.
Example
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_edit_post_after_update', 'wpufe_update_post_price' );
When our post has been updated, we are retrieving a custom field _price
from the post and saving it again as _regular_price
.
Tip
When updating a post, use wpuf_add_post_after_insert
hook.