From 7a032a02d490632351fa4c83743767f9544ae76c Mon Sep 17 00:00:00 2001 From: nikitozzzzzzz Date: Tue, 29 May 2018 22:35:57 +0300 Subject: [PATCH] - fixed issue https://wordpress.org/support/topic/corrections-for-core-um-actions-forms-php-um-v2-0-11/ --- includes/core/um-actions-form.php | 11 ++++++----- includes/core/um-filters-fields.php | 8 ++++---- ultimate-member.php | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/includes/core/um-actions-form.php b/includes/core/um-actions-form.php index 8050be80..5cf15388 100644 --- a/includes/core/um-actions-form.php +++ b/includes/core/um-actions-form.php @@ -314,8 +314,9 @@ function um_submit_form_errors_hook_( $args ) { foreach ( $array['conditions'] as $condition ) { list( $visibility, $parent_key, $op, $parent_value ) = $condition; - if ( ! isset( $args[ $parent_key ] ) ) + if ( ! isset( $args[ $parent_key ] ) ) { continue; + } $cond_value = ( $fields[ $parent_key ]['type'] == 'radio' ) ? $args[ $parent_key ][0] : $args[ $parent_key ]; @@ -337,11 +338,11 @@ function um_submit_form_errors_hook_( $args ) { continue 2; } } elseif ( $op == 'greater than' ) { - if ( $cond_value > $op ) { + if ( $cond_value > $parent_value ) { continue 2; } } elseif ( $op == 'less than' ) { - if ( $cond_value < $op ) { + if ( $cond_value < $parent_value ) { continue 2; } } elseif ( $op == 'contains' ) { @@ -367,11 +368,11 @@ function um_submit_form_errors_hook_( $args ) { continue 2; } } elseif ( $op == 'greater than' ) { - if ( $cond_value <= $op ) { + if ( $cond_value <= $parent_value ) { continue 2; } } elseif ( $op == 'less than' ) { - if ( $cond_value >= $op ) { + if ( $cond_value >= $parent_value ) { continue 2; } } elseif ( $op == 'contains' ) { diff --git a/includes/core/um-filters-fields.php b/includes/core/um-filters-fields.php index 7f55479e..4a2f59bf 100644 --- a/includes/core/um-filters-fields.php +++ b/includes/core/um-filters-fields.php @@ -392,11 +392,11 @@ function um_get_custom_field_array( $array, $fields ) { $array['required'] = 0; } } elseif ( $op == 'greater than' ) { - if ( $cond_value > $op ) { + if ( $cond_value > $parent_value ) { $array['required'] = 0; } } elseif ( $op == 'less than' ) { - if ( $cond_value < $op ) { + if ( $cond_value < $parent_value ) { $array['required'] = 0; } } elseif ( $op == 'contains' ) { @@ -422,11 +422,11 @@ function um_get_custom_field_array( $array, $fields ) { $array['required'] = 0; } } elseif ( $op == 'greater than' ) { - if ( $cond_value <= $op ) { + if ( $cond_value <= $parent_value ) { $array['required'] = 0; } } elseif ( $op == 'less than' ) { - if ( $cond_value >= $op ) { + if ( $cond_value >= $parent_value ) { $array['required'] = 0; } } elseif ( $op == 'contains' ) { diff --git a/ultimate-member.php b/ultimate-member.php index 2197a574..66dd3889 100644 --- a/ultimate-member.php +++ b/ultimate-member.php @@ -3,7 +3,7 @@ Plugin Name: Ultimate Member Plugin URI: http://ultimatemember.com/ Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress -Version: 2.0.17-alpha1 +Version: 2.0.17-alpha2 Author: Ultimate Member Author URI: http://ultimatemember.com/ Text Domain: ultimate-member