- fixed roles field, which isn't customized;

This commit is contained in:
nikitasinelnikov
2020-09-22 14:30:25 +03:00
parent aeb0d7005a
commit 4ac6071aa2
3 changed files with 31 additions and 37 deletions
+5 -5
View File
@@ -3690,11 +3690,11 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
//fix when customers change options for role (radio/dropdown) fields
$intersected_options = array();
foreach ( $options as $option ) {
if ( false !== $search_key = array_search( $option, $roles ) ) {
$intersected_options[ $search_key ] = $option;
} else {
$intersected_options[] = $option;
foreach ( $options as $key => $title ) {
if ( false !== $search_key = array_search( $title, $roles ) ) {
$intersected_options[ $search_key ] = $title;
} elseif ( isset( $roles[ $key ] ) ) {
$intersected_options[ $key ] = $title;
}
}