Trigger action for a specific embedded form

add_filter(‘frm_use_embedded_form_actions’, ‘frm_trigger_embedded_form_actions’, 10, 2); function frm_trigger_embedded_form_actions( $trigger_actions, $args ) { if ( $args[‘form’]->id == 123 ) { $trigger_actions = true; } return $trigger_actions; }Continue reading

Stop user ID filter for admins

add_filter(‘frm_where_filter’, ‘stop_filter_for_admin’, 10, 2); function stop_filter_for_admin( $where, $args ) { if ( $args[‘display’]->ID == 3 && $args[‘where_opt’] == 25 ) { //change 3 to the ID of your View and change 25 to the ID of your user ID field…Continue reading

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

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