Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaeledi/5357db9bb22b167658ce2551312b62bd to your computer and use it in GitHub Desktop.
Save michaeledi/5357db9bb22b167658ce2551312b62bd to your computer and use it in GitHub Desktop.
GP Multi-page Navigation // Gravity Perks // Disable Navigation on First Page Only
<?php
/**
* GP Multi-page Navigation // Gravity Perks // Disable Navigation on First Page Only
*/
// update the "673" to your form ID
add_filter( 'gform_pre_render_673', function( $form ) {
$submission = rgar( GFFormDisplay::$submission, $form['id'] );
// if submission data is not set for this form, we'll assume we're on the first page
if( GFFormDisplay::get_current_page( $form['id'] ) == 1 && ( ! $submission || ! $submission['is_valid'] ) ) {
$form['pagination']['gp-multi-page-navigation_enable'] = false;
}
return $form;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment