From 79ba64f206409373f6c2c9d4837f70b4dda3d579 Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Tue, 17 May 2016 19:35:56 +0800 Subject: [PATCH] Add new filter 'um_submit_form_error' --- core/um-form.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/um-form.php b/core/um-form.php index 756ff515..95ecf08d 100644 --- a/core/um-form.php +++ b/core/um-form.php @@ -38,8 +38,11 @@ class UM_Form { *** @add errors ***/ function add_error( $key, $error ) { - if ( !isset( $this->errors[$key] ) ){ - $this->errors[$key] = $error; + if ( ! isset( $this->errors[ $key ] ) ){ + + $error = apply_filters('um_submit_form_error', $key, $error ); + + $this->errors[ $key ] = $error; } }