Action hooks

This topic contains 1 reply and 2 voices, and was last updated by Tareq Hasan 10 years ago
Viewing 1 Posts - 1 through 1 (of 1 total)
Author Posts
March 26, 2014 at 6:53 am 17336
Tareq Hasan Hi Tareq, I am using custom fields to add action hook on registration form. I am adding buch of new fields. Now fields are displaying on the frontend form. But when I submit form new added fields are not being saved along with other fields. My guess is following action hooks are not being called. I am using sample code for it: code starts here:- function update_my_brand_new_hook( $post_id ) { if ( isset( $_POST['my_custom_field'] ) ) { update_post_meta( $post_id, 'your_meta_key', $_POST['my_custom_field'] ); } } add_action( 'wpuf_add_post_after_insert', 'update_my_brand_new_hook' ); add_action( 'wpuf_edit_post_after_update', 'update_my_brand_new_hook' );
March 27, 2014 at 12:02 am 17360
Tareq Hasan Tareq Hasan

The code is for post forms, not the registration form. Here the code uses update_post_meta function where in registration form, you need to call update_user_meta function.

Also, the hook name will be changed. Instead of using wpuf_add_post_after_insert and wpuf_edit_post_after_update, you’ve to use wpuf_after_register action hook.

Viewing 1 Posts - 1 through 1 (of 1 total)