Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2020
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1.  /* Custom */
  2.     add_filter( 'wpcf7_validate_text', 'xyz_validation', 20, 2 );
  3.      
  4.     function xyz_validation( $result, $tag ) {
  5.    
  6.         $email = isset( $_POST['your-email'] ) ? trim( $_POST['your-email'] ) : '';
  7.         $subject = isset( $_POST['your-subject'] ) ? trim( $_POST['your-subject'] ) : '';
  8.      
  9.         if ( !empty($email) || !empty($subject) ) {
  10.           $result->invalidate( $tag, "Really nigga?" );
  11.         }
  12.      
  13.      
  14.       return $result;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement