Skip to content

Instantly share code, notes, and snippets.

/file1.php Secret

Created February 14, 2017 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/229bd17a0d2458b61256d23ccb960d20 to your computer and use it in GitHub Desktop.
Save anonymous/229bd17a0d2458b61256d23ccb960d20 to your computer and use it in GitHub Desktop.
class GWSubmissionLimit extends GW_Submission_Limit { }
# Configuration
# Basic Usage
$gwsl1 = new GW_Submission_Limit( array(
'form_id' => 61,
'time_period' => '2678400',
'limit_by' => 'role',
'limit_message' => 'Ah nuts. You seem to have reached your lead contact limit for this month. To contact more, go to the <a href="/membership-account/membership-levels/">Membership Levels page</a> to upgrade.',
// when "limit_by" is set to "role", "limit" must be provided as array with roles and their corresponding limits
'limit' => array(
'administrator' => 50,
'super pro' => 18,
'agency' => 12,
'consultant' => 8,
'freelancer' => 3,
'forever free' => 12
)
) );
echo $gwsl1->get_entry_count( 61 );
echo '<br>';
echo $gwsl1->get_limit();
echo '<br>';
echo $gwsl1->get_limit() - $gwsl1->get_entry_count( 61 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment