Export specific columns

add_filter( ‘frm_csv_columns’, ‘export_specific_cols’, 10, 2 ); function export_specific_cols( $headings, $form_id ) { if ( $form_id == 19 ) { $export_columns = array( 363, 425, 579, ‘id’ ); foreach ( $headings as $col_key => $data ) { if ( ! in_array(…Continue reading

Change CSV Filename

add_filter(‘frm_csv_filename’, ‘change_csv_filename’, 10, 2); function change_csv_filename($filename, $form){ if ($form->id == 45){//Change 45 to the ID of your form $filename = date(“ymdHis”,time()) . ‘_’ . sanitize_title_with_dashes($form->name) . ‘_formidable_entries.csv’;//Change the filename here } return $filename; }Continue reading

Filter by date

add_filter(‘frm_csv_where’, ‘limit_csv_by_date’, 10, 2); function limit_csv_by_date($where, $args){ if ( $args[‘form_id’] == 19 ) {// Change 19 to the ID of your form $where[‘form_id’] = 19;// Change 19 to the ID of your form $where[‘created_at >’] = ‘2015-01-01 00:00:00’; $where[‘created_at <‘]…Continue reading

Filter by current user

add_filter(‘frm_csv_where’, ‘limit_csv_to_current_user’, 10, 2); function limit_csv_to_current_user($where, $args){ if ( $args[‘form_id’] == 19 ) {// Change 19 to the ID of your form $current_user = wp_get_current_user(); $where[‘form_id’] = 19;// Change 19 to the ID of your form again $where[‘user_id’] = $current_user->ID;…Continue reading

Set Duplicate Entry to Draft

add_action( ‘frm_after_duplicate_entry’, ‘frm_duplicated_draft’, 10, 3 ); function frm_duplicated_draft( $entry_id, $form_id, $args ){ if ( $form_id == 5 ) { global $wpdb; $wpdb->update( $wpdb->prefix .’frm_items’, array(‘is_draft’ => 1), array( ‘id’ => $entry_id ) ); } }Continue reading

Load Email Settings with AJAX

add_filter(‘frm_email_control_settings’, ‘frm_load_email_settings_with_ajax’); function frm_load_email_settings_with_ajax($settings){ $settings[‘ajax_load’] = true; return $settings; }Continue reading

Change x-axis labels

add_filter( ‘frm_graph_data’, ‘change_my_graph_labels’, 10, 2 ); function change_my_graph_labels( $data, $atts ) { if ( isset( $atts[‘title’] ) && $atts[‘title’] == ‘My graph’ ) { $new_labels = array( ‘First label’, ‘Second label’, ‘Third label’ ); foreach ( $new_labels as $key =>…Continue reading

Send submitted entry to another site

add_filter(‘frm_entries_before_create’, ‘yourfunctionname’, 30, 2); function yourfunctionname( $errors, $form ) { if($form->id == 5){ //replace 5 with the id of the form $args = array(); if(isset($_POST[‘item_meta’][30])) //replace 30 and 31 with the appropriate field IDs from your form $args[‘data1’] = $_POST[‘item_meta’][30];…Continue reading

Check If Value Has Changed

add_filter( ‘frm_pre_update_entry’, ‘check_if_value_changed’, 10, 2 ); function check_if_value_changed( $values, $entry_id ) { $field_id = 125; // change 125 to the id of the field to check $previous_value = FrmEntryMeta::get_entry_meta_by_field($entry_id, $field_id); if ( isset( $values[‘item_meta’][ $field_id ] ) && $values[‘item_meta’][ $field_id…Continue reading