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

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