Adding custom fields to profile
-
I have created a custom field, named mobile_number, with the following configuration:
This field is under the Default Registration and Default Profile forms. On the registration form, it appears correctly:
However, when I try to add it to the user’s account form, it loses the placeholder, help text and icon.
add_action( 'um_after_account_general', 'um_custom_lph_fields', 100 ); function um_custom_lph_fields() { $id = um_user('ID'); $output = '<div class="um-field">'; // Array of meta-keys $names = array( 'mobile_number' ); $fields = array(); foreach( $names as $name ) { $fields[ $name ] = UM()->builtin()->get_specific_field( $name ); } $fields = apply_filters( 'um_account_secure_fields', $fields, $id ); foreach( $fields as $key => $data ) { $output .= UM()->fields()->edit_field( $key, $data ); } $output .= '</div>'; echo $output; }
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Adding custom fields to profile’ is closed to new replies.