Save Custom fields
-
How to save the data of the custom fields? I have created a custom fields in the registration page but I was not able to continue saving those. here are my sample code
add_action('wpas_after_registration_fields', 'wpas_custom_fields', 5 ); function wpas_custom_fields(){ $phone = new WPAS_Custom_Field( 'phone', array( 'name' => 'phone', 'args' => array( 'required' => true, 'field_type' => 'text', 'label' => __( 'Phone Number', 'awesome-support' ), 'placeholder' => __( 'Phone Number', 'awesome-support' ), 'sanitize' => 'sanitize_text_field' ) ) ); echo $phone->get_output(); $address = new WPAS_Custom_Field( 'address', array( 'name' => 'address', 'args' => array( 'required' => true, 'field_type' => 'text', 'label' => __( 'Address', 'awesome-support' ), 'placeholder' => __( 'Address', 'awesome-support' ), 'sanitize' => 'sanitize_text_field' ) ) ); echo $address->get_output(); } add_action( 'wpas_register_account_after', 'wpas_custom_fields_saving', 10, 2 ); function wpas_custom_fields_saving( $user_id, $user_fiels ){ //update_user_meta( $user_id ); //seems like I cant access my custom fields here }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Save Custom fields’ is closed to new replies.