Skip to content

Instantly share code, notes, and snippets.

@boreal321
Created September 17, 2012 01:49
Show Gist options
  • Save boreal321/3735147 to your computer and use it in GitHub Desktop.
Save boreal321/3735147 to your computer and use it in GitHub Desktop.
Gravity Forms hook to stop a form from loading
add_filter('gform_pre_render', 'swp_populate_attendee_list');
function swp_populate_attendee_list($form){
$num = swp_get_the_amount();
if ( count( $num ) < 1 ) {
add_filter('gform_get_form_filter', create_function('', "return 'You have not met the condition! Please go to <a href=\"/?page_id=1\">this form.</a>';") );
}
return $form;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment