I created a custom function on my WordPress site that has a Gravity Form (GF) form on the site where people can pledge to create groups. There are 7 fields on the form (Form ID #1):
- Name
- Organization Name
- Organization Address
- # of Weekday Groups
- # of Weekend Groups
- Total # of Groups (hidden)
The script requests for the leads from GF form #1 and runs it through a foreach loop which keeps added the value from field 7 until there are no entries left.
However, starting today the code is only gathering 30 entries from the form when there are currently 60. Please help.
function test_gf(){
$pledges = RGFormsModel::get_leads('1'); // Form_id
$group_count = 0; // resets group_count
$entries = 0;
foreach ($pledges as $pledge) {
$group_count += $pledge[7]; // Adds each value from Field #7 (Total)
$entries++; // Checking the number of entries processed
}
// HTML Output
echo '<h1>New Groups Pledged: '. $group_count . '</h1>' ;
echo '<h2># of Entries Processed: '.$entries.'</h2>';
}
Exactly:
$page_size=30
, override this default value with bigger number: