mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Fixed: default value with comma for checkbox
This commit is contained in:
@@ -1045,9 +1045,6 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
if ( ! $this->editing || 'custom' == $this->set_mode ) {
|
||||
// show default on register screen if there is default
|
||||
if ( isset( $data['default'] ) ) {
|
||||
if ( ! is_array( $data['default'] ) && strstr( $data['default'], ', ' ) ) {
|
||||
$data['default'] = explode( ', ', $data['default'] );
|
||||
}
|
||||
|
||||
if ( ! is_array( $data['default'] ) && $data['default'] === $value ) {
|
||||
return true;
|
||||
@@ -1061,6 +1058,14 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// default value with comma
|
||||
if ( is_string( $data['default'] ) && strstr( $data['default'], ',' ) ) {
|
||||
$choices = array_map( 'trim', explode( ',', $data['default'] ) );
|
||||
if( in_array( $value, $choices ) ){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user