Count the number of entries in a Gravity Form

How can I sum all entries from a specific field as a counter?

To display number of entries submitted, insert this code on your page:

[php]
<?php
// count all entries for form ID 1, when key 2 has the value “true”
$search_criteria = array(
‘status’ => ‘active’,
‘field_filters’ => array(
array(
‘key’ => ‘2’,
‘value’ => true
)
)
);
$entry_count = GFAPI::count_entries(1, $search_criteria);
?>
[/php]

Submit a Comment

Your email address will not be published. Required fields are marked *