mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Fix for fields shipping_country and billing_country.
Issue: billing_country not working in Default Profile anymore. Link: https://secure.helpscout.net/conversation/907381731/32251?folderId=1651531
This commit is contained in:
@@ -2472,6 +2472,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$output .= '<div class="um-field-icon"><i class="' . $icon . '"></i></div>';
|
||||
}
|
||||
|
||||
$options = array();
|
||||
$has_parent_option = false;
|
||||
$disabled_by_parent_option = '';
|
||||
$atts_ajax = '';
|
||||
@@ -2604,10 +2605,21 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$options = UM()->builtin()->get ( $filter );
|
||||
}
|
||||
|
||||
if ( ! isset( $options ) ) {
|
||||
// 'country'
|
||||
if( $key === 'country' && empty( $options ) ) {
|
||||
$options = UM()->builtin()->get( 'countries' );
|
||||
}
|
||||
|
||||
// 'billing_country' and 'shipping_country'
|
||||
if( in_array( $key, array( 'billing_country', 'shipping_country' ) ) ) {
|
||||
$countries = UM()->builtin()->get( 'countries' );
|
||||
if( empty( $options ) || !is_array( $options ) ) {
|
||||
$options = $countries;
|
||||
} else {
|
||||
$options = array_intersect_key( $countries, array_flip( $options ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $options ) ) {
|
||||
/**
|
||||
* UM hook
|
||||
|
||||
Reference in New Issue
Block a user