Automatically update a field in another form

add_action(‘frm_after_create_entry’, ‘link_fields’, 30, 2); add_action(‘frm_after_update_entry’, ‘link_fields’, 10, 2); function link_fields($entry_id, $form_id){ if($form_id == 113){//Change 113 to the ID of the first form global $wpdb; $first_field = $_POST[‘item_meta’][25]; //change 25 to the ID of the field in your first form $user…Continue reading

Update or create another entry

add_action(‘frm_after_create_entry’, ‘update_or_create_entry’, 30, 2); add_action(‘frm_after_update_entry’, ‘update_or_create_entry’, 10, 2); function update_or_create_entry($entry_id, $form_id){ if ( $form_id == 430 ) {//Change 430 to the ID of Form A global $wpdb; $form2 = ‘480‘;//Change 480 to the ID of Form B //Get user and…Continue reading

Remove Extra Address Columns on Export

add_filter( ‘frm_csv_columns’, ‘remove_extra_address_columns’, 10, 2 ); function remove_extra_address_columns( $headings, $form_id ) { if ( $form_id == 568 ) { //change 568 to your Form ID $address_field_id = ‘3855’; //change 3855 to your Address Field ID unset( $headings[$address_field_id . ‘_line1’] );…Continue reading

Use a custom URL

add_filter( ‘frm_jquery_ui_base_url’, ‘change_google_url’ ); function change_google_url( $url ) { return ‘http://example.com/’; }Continue reading

Basic Example

add_filter(‘frm_graph_value’, ‘my_custom_graph_value’, 10, 2); function my_custom_graph_value( $value, $field ) { if ( $field->id == 123 ) { $value = ‘new value’; } return $value; }Continue reading

Import file from URL

add_filter(‘frm_pre_create_entry’, ‘frm_upload_from_url’); function frm_upload_from_url( $values ) { if ( $values[‘form_id’] == 5 ) { //change 5 to your form id $upload_field_id = 25; // replace 25 with the id of your upload field $url_field = 24; // replace 24 with…Continue reading

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