Hook to update user profiles metadata
Author | Posts |
---|---|
September 19, 2013 at 10:22 pm 8319 | |
alsur | We are trying to combine WPUF with the Advanced Custom Fields (ACF) plugin without success. ACF works great for metadata as it generates code for different metadata types with just one call. We are following this procedure: http://support.advancedcustomfields.com/forums/topic/front-end-and-custom-user-meta/ The concept as we understand is that we need to add an action to a hook on the user data saving: // $post_id to save against $post_id = 'user_' . $user_id; // update the post do_action('acf/save_post', $post_id); We are trying to hook it to 'wpuf_update_profile' but the metadata seems blank at that stage and we are not sure how to search for an alternative hook while using WPUF for the users front profile edit. Thanks |
September 27, 2013 at 9:43 pm 8502 | |
Tareq Hasan | Yes, you’ve to use Action Hook field field. Take a look how to use the action hook field field. Use this kind of code below in Now you’ve to update the field value. In the |
September 27, 2013 at 11:14 pm 8507 | |
alsur | Thanks. We now paint the ACF form correctly “inside” the WPUF form and we’ve checked the variables arrive correctly by post, but when we hook to the do_action save of ACF nothing gets saved. I understand this might be out of the WPUF concept but any help or alternative hook to connect to would be appreciated. Code we are using currently:
function update_my_brand_new_hook( $post_id ) { $user_id = wp_get_current_user(); // $post_id to save against // update the post //print_r($_POST); add_action( 'wpuf_update_profile', 'update_my_brand_new_hook' ); |