Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save spivurno/49ceb0a71014cea4451463d2861b2a39 to your computer and use it in GitHub Desktop.
Save spivurno/49ceb0a71014cea4451463d2861b2a39 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