Created
September 17, 2012 01:49
-
-
Save boreal321/3735147 to your computer and use it in GitHub Desktop.
Gravity Forms hook to stop a form from loading
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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