| @@ -3,14 +3,8 @@ | ||
| 3 | 3 | die( 'You are not allowed to call this page directly.' ); |
| 4 | 4 | } |
| 5 | 5 | |
| 6 | 6 | class FrmEntryValidate { |
| 7 | - | |
| 8 | - /** | |
| 9 | - * @param array $values | |
| 10 | - * @param string[]|bool $exclude | |
| 11 | - * @return array | |
| 12 | - */ | |
| 13 | 7 | public static function validate( $values, $exclude = false ) { |
| 14 | 8 | FrmEntry::sanitize_entry_post( $values ); |
| 15 | 9 | $errors = array(); |
| 16 | 10 | |
| @@ -49,15 +43,9 @@ | ||
| 49 | 43 | * @param array $errors Errors data. |
| 50 | 44 | * @param array $values Value data of the form. |
| 51 | 45 | * @param array $args Custom arguments. Contains `exclude` and `posted_fields`. |
| 52 | 46 | */ |
| 53 | - $filtered_errors = apply_filters( 'frm_validate_entry', $errors, $values, compact( 'exclude', 'posted_fields' ) ); | |
| 54 | - | |
| 55 | - if ( is_array( $filtered_errors ) ) { | |
| 56 | - $errors = $filtered_errors; | |
| 57 | - } else { | |
| 58 | - _doing_it_wrong( __FUNCTION__, 'Only arrays should be returned when using the frm_validate_entry filter.', '6.3' ); | |
| 59 | - } | |
| 47 | + $errors = apply_filters( 'frm_validate_entry', $errors, $values, compact( 'exclude', 'posted_fields' ) ); | |
| 60 | 48 | |
| 61 | 49 | return $errors; |
| 62 | 50 | } |
| 63 | 51 | |