The gform_form_list_forms is a Gravity Forms PHP filter that allows you to filter the forms displayed on the form listing page. It should be used in conjunction with the gform_form_list_count hook to adjust the counts.
Usage
add_filter('gform_form_list_forms', 'your_function_name', 10, 6);
Parameters
$forms
(array) – The complete list of forms.$search_query
(string) – The search query string if set.$active
(bool) – If inactive forms should be displayed.$sort_column
(string) – List column being sorted.$sort_direction
(string) – Direction of column sorting.$trash
(bool) – If trash items should be displayed.
More information
See Gravity Forms Docs: gform_form_list_forms
Examples
Remove half of the forms
This example filters the forms to display only half of them.
add_filter('gform_form_list_forms', 'filter_forms', 10, 6); function filter_forms($forms, $search_query, $active, $sort_column, $sort_direction, $trash) { // Remove half of the forms $forms = array_slice($forms, 0, round(count($forms) / 2)); return $forms; }
Place this code in the functions.php
file of your active theme.