Fix radio and checkbox fields selection

This commit is contained in:
champsupertramp
2016-09-07 17:10:06 +08:00
parent 78bd045dc1
commit 19da4c2860
2 changed files with 9 additions and 6 deletions
+4 -2
View File
@@ -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;
}
+5 -4
View File
@@ -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;
}
}