Default select option for countries + user roles
-
Hi.
I think there is a room for improvement in Country Select predefined field.1) in the Default Option, where one could select pre-selected country, it would be good to have a NULL option, which would work well with your code on line 18 of select-country.php
$input_value = ( ! empty( $field['default-option-country'] ) ? $country_array[trim( $field['default-option-country'] )] : '' );
Currently it always sets Afghanistan as the pre-selected option.
2) Your declaration and definition of $extra_select_option on line 33 of the same PHP file doesn’t seem to work.
$extra_select_option = apply_filters( 'wppb_extra_select_option', '', $field, $item_title );
To overcome the above problems, I had to change line 18 to:
$input_value = '';
and line 35 to:
$output .= '<option value="" class="custom_field_select_option " disabled selected>Select your Country...</option>';My second point also applies to the predefined Role Select field. Here I had to edit user-role.php on line 70, from:
$output .= $extra_select_option;
to:
$output .= '<option value="" class="custom_field_select_option " disabled selected>Select your Role... *</option>';I hope this helps.
Cheers!
E
The topic ‘Default select option for countries + user roles’ is closed to new replies.