Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Custom */
- add_filter( 'wpcf7_validate_text', 'xyz_validation', 20, 2 );
- function xyz_validation( $result, $tag ) {
- if ( 'your-subject' == $tag->name ) {
- $email = isset( $_POST['your-email'] ) ? trim( $_POST['your-email'] ) : '';
- $subject = isset( $_POST['your-subject'] ) ? trim( $_POST['your-subject'] ) : '';
- if ( empty($email) && empty($subject) ) {
- $result->invalidate( $tag, "Really nigga?" );
- }
- }
- return $result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement