- fix for profile form;

This commit is contained in:
Mykyta Synelnikov
2023-07-01 01:52:43 +03:00
parent 2ca243787e
commit dad4c8017c
7 changed files with 114 additions and 155 deletions
+5 -4
View File
@@ -1,8 +1,9 @@
<?php
namespace um\core;
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'um\core\Validation' ) ) {
@@ -32,7 +33,7 @@ if ( ! class_exists( 'um\core\Validation' ) ) {
* Validation constructor.
*/
public function __construct() {
add_filter( 'um_user_pre_updating_files_array', array( $this, 'validate_files' ), 10, 1 );
add_filter( 'um_user_pre_updating_files_array', array( $this, 'validate_files' ) );
add_filter( 'um_before_save_filter_submitted', array( $this, 'validate_fields_values' ), 10, 3 );
}
@@ -65,7 +66,7 @@ if ( ! class_exists( 'um\core\Validation' ) ) {
}
//rating field validation
if ( isset( $fields[ $key ]['type'] ) && $fields[ $key ]['type'] == 'rating' ) {
if ( isset( $fields[ $key ]['type'] ) && 'rating' === $fields[ $key ]['type'] ) {
if ( ! is_numeric( $value ) ) {
unset( $changes[ $key ] );
} else {