Home Forums Plugin Support WP User Frontend Pro Action hooks

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  Tareq Hasan 5 years, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #17336

    Post count: 2

    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' );


    Tareq Hasan
    Post count: 2831

    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 2 posts - 1 through 2 (of 2 total)

The topic ‘Action hooks’ is closed to new replies.