frm_display_entry_content

Back to Top
Knowledge BaseDisplay Data → frm_display_entry_content

Use this hook to customize content in your View.

Usage

add_filter('frm_display_entry_content', 'frm_custom_content', 20, 7);

Parameters

  • $new_content (string)
  • $entry
  • $shortcodes (array of shortcodes used in View)
  • $display (object)
  • $show
  • $odd
  • $atts (array)

Examples

Formidable Hook - Helpful

Add row counter

Submitted by  — 8 years ago

Insert [row_num] into your view content, and it will be replaced with the row number of that entry.
Use this code to display row numbers for a table View.

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 - 1) * $page_size;
        $current_count = $atts['count'] + $prev_total;
        $new_content = str_replace('[row_num]', $current_count, $new_content);
    } else {
        $new_content = str_replace('[row_num]', $atts['count'], $new_content);
    }
}
  return $new_content;
}

Replace 169 with the ID of your View.

If you would like to add your own example, click here.

Have something to add?

Click here to provide feedback on this page.