gravityflow_discussion_items_display_limit

Description

Set the amount of discussion items to be shown in non-print inbox / status view when the discussion field toggle is active. Allows the number of items to be displayed on an status page or inbox pages to be filtered.

Parameters

ParameterTypeDetails
$display_limitIntegerAmount of comments to be shown. Default is 10.
$discussion_fieldFieldThe field currently being processed.

Examples

Change the display limit to 5 for a specific form/field

1
2
3
4
5
6
7
8
9
10
add_filter( 'gravityflow_discussion_items_display_limit', 'limit_discussion_display', 10, 2 );
function limit_discussion_display( $display_limit, $discussion_field ) {
 
    //Change to control which form / field the limit change is applied to
    if ( $discussion_field['formId'] == '25' && $discussion_field['id'] == '1' ) {
        //gravity_flow()->log_debug( __METHOD__ . '(): JO: ' . print_r( $discussion_field, true ) );
        $display_limit = 5;
    }
    return $display_limit;
}

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?