mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Fix radio and checkbox fields selection
This commit is contained in:
+4
-2
@@ -482,8 +482,6 @@ class UM_Fields {
|
||||
|
||||
if ( isset( $ultimatemember->form->post_form[$key] ) && is_array( $ultimatemember->form->post_form[$key] ) ) {
|
||||
|
||||
echo "<script>console.log(".json_encode( array( "post", $value, $ultimatemember->form->post_form[$key] ) ).");</script>";
|
||||
|
||||
if ( in_array( $value, $ultimatemember->form->post_form[$key] ) ){
|
||||
return true;
|
||||
}
|
||||
@@ -500,6 +498,10 @@ class UM_Fields {
|
||||
|
||||
$um_user_value = um_user( $key );
|
||||
|
||||
if( $key == 'role' ){
|
||||
$um_user_value = strtolower( $um_user_value );
|
||||
}
|
||||
|
||||
if ( $um_user_value == $value ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -203,8 +203,8 @@
|
||||
);
|
||||
|
||||
$replace = apply_filters('um_template_tags_replaces_hook', $replace);
|
||||
|
||||
$content = wp_kses_decode_entities( str_replace($search, $replace, $content) );
|
||||
|
||||
$content = wp_kses_decode_entities( str_replace($search, $replace, $content) );
|
||||
|
||||
if ( isset( $args['tags'] ) && isset( $args['tags_replace'] ) ) {
|
||||
$content = str_replace($args['tags'], $args['tags_replace'], $content);
|
||||
@@ -1363,11 +1363,11 @@ function um_fetch_user( $user_id ) {
|
||||
$value = unserialize( $value );
|
||||
}
|
||||
|
||||
if( $data == 'role' ){
|
||||
if( in_array( $data, array('role','gender') ) ){
|
||||
if( is_array( $value ) ){
|
||||
$value = implode(",", $value );
|
||||
}
|
||||
return strtolower($value);
|
||||
return $value;
|
||||
}
|
||||
|
||||
return $value;
|
||||
@@ -1597,6 +1597,7 @@ function um_fetch_user( $user_id ) {
|
||||
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user