Add Dynamic Total to Before Content

add_filter(‘frm_before_display_content’, ‘dynamic_frm_stats’, 10, 4); function dynamic_frm_stats($content, $display, $show, $atts){ if ( $display->ID == 1066 ) {//Change 1066 to the ID of your View $entries = $atts[‘entry_ids’]; $total = 0; foreach($entries as $entry){ $current_value = FrmProEntriesController::get_field_value_shortcode(array( ‘field_id’ => x, ‘entry’ =>…Continue reading

Add Field Total to After Content

add_filter(‘frm_after_display_content’, ‘add_view_total_to_after_content’, 30, 4); function add_view_total_to_after_content($after_content, $display, $show, $atts){ if ( $display->ID == 1066 ) {//Change 1066 to the ID of your View $entries = $atts[‘entry_ids’]; $total = 0; foreach($entries as $entry){ $current_value = FrmProEntriesController::get_field_value_shortcode(array( ‘field_id’ => x, ‘entry’ =>…Continue reading

Add row counter

add_filter(‘frm_display_entry_content’, ‘frm_get_row_num’, 20, 7); function frm_get_row_num($new_content, $entry, $shortcodes, $display, $show, $odd, $atts){ if ( $display->ID == 169 ) { if ( isset($_GET[‘frm-page-‘ . $display->ID]) ) { $page_num = absint( $_GET[‘frm-page-‘ . $display->ID] ); $page_size = $display->frm_page_size; $prev_total = ($page_num –…Continue reading

Basic Format

add_filter(‘frm_display_entries_content’, ‘frm_replace_content’, 20, 4); function frm_replace_content($new_content, $entries, $shortcodes, $display){ if($display->ID == 1066){//Replace 1066 with the ID of your View $new_content = “Your custom content here”; } return $new_content; }Continue reading

Add result counts with page size of 1

add_filter(‘frm_display_entry_content’, ‘frm_filter_content’, 20, 7); function frm_filter_content($content, $entry, $shortcodes, $display, $show, $odd, $atts) { if ( isset($atts[‘pagination’]) && $atts[‘count’] == 1 && $display->ID == 100 ) { //change 100 to your display ID $content = ‘Viewing Project 1 to ‘ .…Continue reading

Remove message

add_filter( ‘frm_no_entries_message’, ‘remove_no_entries_message’, 10, 2); function remove_no_entries_message( $message, $args ) { if ( $args[‘display’]->ID == 1066 ) { $message = ”; } return $message; }Continue reading

Remove surrounding div

add_filter( ‘frm_no_entries_message’, ‘remove_no_entries_message_div’, 10, 2); function remove_no_entries_message_div( $message, $args ) { if ( $args[‘display’]->ID == 1066 ) { $message = str_replace( ‘<div class=”frm_no_entries”>’, ”, $message ); $message = substr( $message, 0, -6 ); } return $message; }Continue reading

Replace “No Data” Message

add_filter(‘frm_no_data_graph’, ‘no_data_graphs’, 10, 2); function no_data_graphs($html){ $html = ‘There are no entries for this graph. Sorry!’; //replace this text string return $html; }Continue reading

Selectively strip HTML

add_filter(‘frmpro_fields_replace_shortcodes’, ‘frm_filter_some_html’, 10, 4); function frm_filter_some_html($replace_with, $tag, $atts, $field){ if ( isset($atts[‘leave_html’]) ) { $tags = explode(‘,’, $atts[‘leave_html’]); $allowed_tags = array(); foreach ( $tags as $tag ) { $allowed_tags[$tag] = array(); } $replace_with = wp_kses($replace_with, $allowed_tags); } return $replace_with; }Continue reading

Greater than and less than

add_filter(‘frmpro_fields_replace_shortcodes’, ‘frm_greater_than_less_than’, 10, 4); function frm_greater_than_less_than($replace_with, $tag, $atts, $field){ if ( isset ( $atts[‘greater_than’] ) && isset( $atts[‘less_than’] ) ) { if ( $replace_with > $atts[‘greater_than’] && $replace_with < $atts[‘less_than’] ) { // do nothing if there’s a match }…Continue reading