Change cron job

add_filter(‘frm_mark_abandonment_entries_period’, ‘change_cron_job’); function change_cron_job() { return 2; //This is 1 by default and it would increase to 2 by utilizing this hook. }Continue reading

Exclude fields from abandonment

add_filter(‘frm_abandonment_exclude_field_types’, ‘frm_abandonment_exclude_field_types’); function frm_abandonment_exclude_field_types($excluded_fields){ return array_merge($excluded_fields, array(‘number’));// This will exclude number field besides default password field. }Continue reading

Show results that begin with search query

add_filter(‘frm_chosen_js’, ‘chosen_js’); function chosen_js( $opts ) { $opts = array( ‘allow_single_deselect’ => true, ‘no_results_text’ => __( ‘No results match’, ‘formidable’ ), ‘search_contains’ => false, ); return $opts; }Continue reading

Change the CSS location

add_filter(‘get_frm_stylesheet’,’frm_stylesheet_change_loc’); function frm_stylesheet_change_loc( $sheet ) { $sheet[‘formidable’] = home_url() . ‘/something.css’; //Replace something.css return $sheet; } //When we want to save the $css option when saving the style, we can hook in there too to generate the file. add_action(‘update_option_frmpro_css’,’save_css_string’); function…Continue reading

Calculate total time in a repeater

add_filter(‘frm_validate_field_entry’, ‘calculate_time’, 11, 3); function calculate_time($errors, $field, $value){ $repeater_id = 1457; $hidden_field_id = 1456; // The field which will hold the total. $start_field_id = 1454; $end_field_id = 1455; if ( $hidden_field_id !== (int) $field->id ) { return $errors; } $repeater_meta…Continue reading

Limit options in TinyMCE Editor

add_filter(‘frm_rte_options’, ‘rte_limit_options’, 10, 2); function rte_limit_options($opts, $field){ $opts[‘tinymce’] = array(“toolbar1” => “undo redo bold italic alignleft aligncenter alignright alignjustify | bullist numlist outdent indent”); return $opts; }Continue reading

Reverse entry order in a repeater

add_filter(‘frmpro_fields_replace_shortcodes’, ‘reverse_entry_order_repeater’, 10, 4); function reverse_entry_order_repeater( $value, $tag, $atts, $field ) { if ( ! empty( $atts[‘foreach_entry_order’] ) && ‘desc’ === $atts[‘foreach_entry_order’] ) { arsort( $value ); } return $value; }Continue reading

Filter payment method

add_filter(‘frm_stripe_payment_method_types’, ‘filter_stripe_payment_method’, 10, 2); function filter_stripe_payment_method( $payment_method_types, $args ) { $map = array( 75 => array( ‘affirm’ ), 76 => array( ‘card’, ‘link’, ‘klarna’ ), ); $form_id = $args[‘form_id’]; if ( isset( $map[ $form_id ] ) ) { $payment_method_types =…Continue reading

Generate slug for the View detail page

add_filter(‘frm_validate_entry’, ‘key_as_slug’, 20, 2); function key_as_slug($errors, $values){ if ( $values[‘form_id’] == 40) { //Change 40 to the ID of your form $string = $_POST[‘item_meta’][21]; //change 21 to the ID of the first field (i.e. the business name field) $count =…Continue reading

Customize downloaded PDF filename to match post title

add_filter(‘frm_pdfs_export_file_name’, ‘use_post_title_for_pdf_filename’ , 10, 2); function use_post_title_for_pdf_filename( $file_name, $args ) { $target_form_id = 23; //Change 23 to the ID of the form. if ( $target_form_id !== (int) $args[‘entry’]->form_id ) { return $file_name; } $post_id = $args[‘entry’]->post_id; if ( ! $post_id…Continue reading