I'm running pre-render filter to do some calculations for number of items available for a product with a limited supply. I'm finding that GFFormsModel::get_leads isn't returning all my form entries.
For example:
add_action('gform_pre_render_2', 'gform_display_limit');
function gform_display_limit($form) {
$entryCount = 0;
$entries = GFFormsModel::get_leads($form['id']);
foreach($entries as &$entry){
$entryCount++;
}
$form['description'] .= $entryCount;
return $form;
}
Shows a value of 30 for $entryCount even though I have 52 form entries.
This is a simplified example. What I actually need to do is loop through all the entries, check the value of a specific field and do some calculations based on that field.
But if get_leads isn't returning all my form entries, this doesn't really work. Is this expected behavior of get_leads or am I doing something wrong?