Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save divienginesupport/7f277cee99b96bb99c477900abdc54fe to your computer and use it in GitHub Desktop.
Save divienginesupport/7f277cee99b96bb99c477900abdc54fe to your computer and use it in GitHub Desktop.
// This filter will work for contact from conditional recipients. The custom_contact_recipient is the function name.
add_filter('df_contact_recipient', 'custom_contact_recipient', 10, 3);
// Use this filter will work for my create post form type. The custom_form_recipient is the function name
add_filter('df_notification_recipient', 'custom_form_recipient', 10, 3);
// This is the function for the contact form
function custom_contact_recipient( $mail_to, $form_id, $form_data ) {
/*** Your conditions go here ***/
}
// This is the function for the create post form type - you can put conditions here for any form type
function custom_form_recipient( $mail_to, $form_id, $form_data ) {
/*** Your conditions go here ***/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment