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

Show total of items at the end of a table view

add_filter( ‘frm_display_inner_content_before_add_wrapper’, ‘table_view_total_row’, 10, 3 ); function table_view_total_row( $inner_content, $view, $args ) { if ( ! empty( $args[‘is_table_view’] ) ) { $total_columns = count( $args[‘box_content’] ); $total_items = count( $args[‘record_count’] ); $inner_content .= ‘<tr><td colspan=”‘ . intval( $total_columns ) .…Continue reading

Add custom class for table view

add_filter( ‘frm_views_table_class’, ‘table_view_class’, 10, 2 ); function table_view_class( $table_class, $args ) { // Remove zebra styling. $table_class = str_replace( ‘frm-alt-table’, ”, $table_class ); // Add custom class. $table_class .= ‘ your-custom-class’; return $table_class; }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