Skip to content

Instantly share code, notes, and snippets.

/file1.php Secret

Created December 21, 2016 05:49
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/d01c641a572379ecd0e037f1314e95cf to your computer and use it in GitHub Desktop.
Save anonymous/d01c641a572379ecd0e037f1314e95cf to your computer and use it in GitHub Desktop.
class Custom_Submission_Limit extends GW_Submission_Limit {
public function is_applicable_form( $form ) {
$form_id = isset( $form['id'] ) ? $form['id'] : $form;
return in_array( $form_id, array( 2, 3, 4, 5, 9 ) );
}
}
# Configuration
# Basic Usage
new Custom_Submission_Limit( array(
'limit_by' => 'field_value',
'limit' => array(
// "18" is your field ID, "1" is your limit for this field ID
18 => 1
),
'time_period' => 60 * 60 * 24 * 10,
'limit_message' => 'Ati trimis deja o solicitare in ultimele 10 zile.'
) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment