Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // http://www.gravityhelp.com/forums/topic/display-number-of-form-entries-left-per-form
- // change 3 here to your form ID
- add_filter('gform_pre_render_3', 'show_entries_left');
- function show_entries_left($form) {
- // get the number of entries for this form
- $entry_count = RGFormsModel::get_lead_count($form['id'], "", null, null, null, null);
- // subtract the entry count from the limit to determine how many are left
- $left = $form['limitEntriesCount'] - $entry_count;
- // append the number of entries left to the description displayed before the form
- $form['description'] .= "Hurry! Only <strong>$left</strong> more entries will be accepted.";
- // return the form
- return $form;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement