Check if one of two fields contains a value

add_filter(‘frm_where_filter’, ‘custom_or_filter’, 10, 2); function custom_or_filter($where, $args){ if ( $args[‘display’]->ID == 3 && $args[‘where_opt’] == 100 ) {//Change 3 to the ID of the View. Change 100 to the ID of the field you have added as a filter and…Continue reading

Add two filters combined with OR

add_filter(‘frm_where_filter’, ‘custom_or_filter_two_values’, 10, 2); function custom_or_filter_two_values($where, $args){ $view_id = 4131;// Replace with your View ID $field_1 = 363;// Replace with ID of Field A $field_2 = 426;// Replace with the ID of Field B $search_term_1 = ‘test’;// Replace with the…Continue reading

Check if current user is owner/creator

add_filter(‘frmpro_fields_replace_shortcodes’, ‘frm_userid_shortcode1’, 10, 4); function frm_userid_shortcode1($replace_with, $tag, $atts, $field){ if(isset($atts[‘is_current_user’])){ global $user_ID; if ( !$user_ID || ( $user_ID && $user_ID != $replace_with ) ) { $replace_with = ”; } } return $replace_with; }Continue reading

Email Routing

add_filter(‘frm_to_email’, ‘custom_set_email_value’, 10, 4); function custom_set_email_value($recipients, $values, $form_id, $args){ if($form_id == 5 && $args[’email_key’] == 4933){ // change 5 to the id of your form and 4933 with the ID of the email foreach ( $values as $value ) {…Continue reading

Conditionally stop email

add_filter(‘frm_to_email’, ‘stop_the_email’, 10, 4); function stop_the_email($recipients, $values, $form_id, $args){ if ( $form_id == 5 && $args[’email_key’] == 123 ) { //change 5 to the id of the form and 123 to the ID of your email notification if ( isset(…Continue reading

Attach a static file

add_filter(‘frm_notification_attachment’, ‘add_my_attachment’, 10, 3); function add_my_attachment($attachments, $form, $args){ //$args[‘entry’] includes the entry object if ( $args[’email_key’] == 1277 ) { //change 1277 to the ID of your email notification $attachments[] = ABSPATH . ‘/’.’wp-content/uploads/2015/02/filename.pdf’; //set the ABSOLUTE path to the…Continue reading

Remove automatic attachment

add_filter(‘frm_notification_attachment’, ‘remove_my_attachment’, 10, 3); function remove_my_attachment($attachments, $form, $args) { if ( $args[’email_key’] == 1277 ) { //change 1277 to the email ID that you would like to DROP the attachment for $attachments = array(); //remove all attachments } return $attachments;…Continue reading

Customize Email Subject

add_filter(‘frm_email_subject’, ‘change_subject’, 10, 2); function change_subject($subject, $atts){ extract($atts); if($form->id == 45){ //Replace 45 with the ID of your form. $subject = ‘Thank You’; //Replace Thank You with your email subject } return $subject; }Continue reading