Last active
August 17, 2017 14:53
-
-
Save nefeline/78246d43adcd1b90a31eafb5a5e17cbe to your computer and use it in GitHub Desktop.
Set email field as required
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This snippet sets the Organizer's name, e-mail and phone fields as required in Community Events Submission Form | |
add_filter( 'tribe_events_community_required_fields', 'require_organizer' ); | |
function require_organizer( $fields ) { | |
if ( ! is_array( $fields ) ) { | |
return $fields; | |
} | |
$fields[] = 'organizer'; | |
return $fields; | |
} | |
add_filter( 'tribe_events_community_required_organizer_fields', 'require_organizer_email' ); | |
function require_organizer_email( $fields ) { | |
if ( ! is_array( $fields ) ) { | |
return $fields; | |
} | |
$fields[] = 'Email'; | |
$fields[] = 'Phone'; | |
return $fields; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment