Skip if one of two fields is empty

add_filter( ‘frm_skip_form_action’, ‘form_action_conditions’, 10, 2 ); function form_action_conditions( $skip_this_action, $args ) { if ( $args[‘action’]->ID == 115 ) {//replace 115 with your action ID if ( is_object( $args[‘entry’] ) ) { $entry = $args[‘entry’]; } else { $entry = FrmEntry::getOne(…Continue reading

Adjust values displayed in cart

add_filter( ‘wc_fp_cart_item_data’, ‘modify_frm_woo_display’, 10, 2 ); function modify_frm_woo_display( $values, $args ) { if ( in_array( $args[‘field’]->id, array( 123, 124, 125 ) ) ) { $end_position = strpos( $values[‘display’], ‘ (‘ ); $values[‘display’] = substr( $values[‘display’], 0, $end_position ); } return…Continue reading

Basic Example

add_filter(‘frm_field_div_classes’, ‘add_div_class’, 10, 2); function add_div_class($classes, $field){ $space = ‘ ‘; if($field[‘id’] == 3137){ //change 3137 to the ID of your field $classes .= $space . ‘class_name‘; //change class_name to your CSS class } return $classes; }Continue reading

Enable Meta Keys for Single Form

add_filter(‘frm_include_meta_keys’, ‘include_meta_keys_for_single_form’, 10, 2); function include_meta_keys_for_single_form( $include_keys, $args ) { if ( $args[‘form_id’] == 364 ) { //replace 364 with Form ID $include_key = true; } return $include_key; }Continue reading

Add a mask to Credit Card

add_filter( ‘frm_input_masks’, ‘add_cc_mask’, 10, 2 ); function add_cc_mask( $masks, $forms_on_page ) { foreach ( $forms_on_page as $form ) { if ( $form->id == 10 ) { // replace 10 with your form id $masks[‘FIELDKEYHERE_cc’] = ‘9999-9999-9999-9999’; // replace FIELDKEYHERE with…Continue reading

Only allow the action once

add_filter( ‘frm_skip_form_action’, ‘stop_multiple_actions’, 20, 2 ); function stop_multiple_actions( $skip_this_action, $args ) { if ( $args[‘action’]->ID == 115 && ! $skip_this_action ) { //replace 115 with your action ID $entry_id = $args[‘entry’]; if ( is_object( $args[‘entry’] ) ) { $entry_id =…Continue reading

Basic Example

add_filter(‘frm_graph_data’, ‘my_custom_graph_data’, 10, 2); function my_custom_graph_data( $data, $atts ) { if ( isset( $atts[‘title’] ) && $atts[‘title’] == ‘My graph’ ) { $data[] = array( ‘X-axis label’, 10, 20, 30 ); } return $data; }Continue reading

Basic Example

add_filter(‘frm_send_email’, ‘frm_stop_email_with_no_entries’, 10, 2); function frm_stop_email_with_no_entries( $send, $email){ if ($email[‘message’] == ‘No Entries Found’) { $send = false; } return $send; }Continue reading