Turn off Dropzone on one page

add_filter( ‘frm_load_dropzone’, ‘stop_dropzone’ ); function stop_dropzone( $load_it ) { if ( is_page(25) ) { // set the page or other conditions here $load_it = false; } return $load_it; }Continue reading

Change View order based on URL parameter

add_filter( ‘frm_filter_view’, ‘change_my_view_object’, 10, 1); function change_my_view_object( $view ) { if ( $view->ID === 123 ) { if ( isset( $_GET[‘my_param’] ) && $_GET[‘my_param’] == ‘custom_value’ ) { $view->frm_order_by = array( 150 ); $view->frm_order = array( ‘DESC’ ); } }…Continue reading

Send separate emails for a specific action

add_filter(‘frm_send_separate_emails’, ‘frm_send_separate_emails’, 10, 2); function frm_send_separate_emails( $is_separate, $args ) { if ( in_array( $args[‘action’]->ID, array( 4933, 4924 ) ) ) { $is_separate = true; } return $is_separate; }Continue reading

Don’t validate reCaptcha during API request

add_filter( ‘frm_is_field_hidden’, ‘mark_recaptcha_hidden’, 20, 2 ); function mark_recaptcha_hidden( $hidden, $field ) { $is_api_request = defined( ‘REST_REQUEST’ ) && REST_REQUEST; if ( FrmField::is_field_type( $field, ‘captcha’ ) && $is_api_request ) { $hidden = true; } return $hidden; }Continue reading

Create an entry in another form

add_action(‘frm_after_create_entry’, ‘create_entry_after_submission’, 30, 2); function create_entry_after_submission($entry_id, $form_id){ if ( $form_id != 372 ) {//Change 372 to the ID of Form A return; } $form2 = ‘373‘;//Change 373 to the ID of Form B //Get user if (!isset($_POST[‘frm_user_id’])){ return; } $user…Continue reading

Run code when user saves a draft

add_action(‘frm_after_create_entry’, ‘frm_after_save_draft’, 30, 2); add_action(‘frm_after_update_entry’, ‘frm_after_save_draft’, 30, 2); function frm_after_save_draft($entry_id, $form_id){ if ( $form_id == 221 ) { //change 221 to the ID of your form if ($_POST[‘frm_saving_draft’] == 1) { // do something here } } }Continue reading

Move and rename files

add_action( ‘frm_after_create_entry’, ‘frm_move_file_and_rename’ ); function frm_move_file_and_rename() { $field_ids = array( 25, 26 ); // change field IDs to the IDs of your file upload fields foreach ( $field_ids as $field_id ) { if ( isset( $_POST[‘item_meta’][ $field_id ] ) )…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