Skip to content

Commit f1958e2

Browse files
barthcclaygriffiths
authored andcommitted
gw-cache-buster.php: Fixed GP Multi-Page Navigation compatibility issue where custom starting pages are not applied.
1 parent 117ba4e commit f1958e2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

gravity-forms/gw-cache-buster.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Plugin URI: https://gravitywiz.com/cache-busting-with-gravity-forms/
1010
* Description: Bypass your website cache when loading a Gravity Forms form.
1111
* Author: Gravity Wiz
12-
* Version: 0.6.1
12+
* Version: 0.6.2
1313
* Author URI: https://gravitywiz.com
1414
*/
1515
class GW_Cache_Buster {
@@ -337,6 +337,14 @@ public function ajax_get_form() {
337337
return rgar( $_REQUEST, 'form_theme' ) ?: $slug;
338338
}, 10, 2 );
339339

340+
add_filter( 'gpmpn_default_page_' . $form_id, function( $page ) {
341+
if ( rgars( $_REQUEST, 'atts/page' ) && rgget( 'gpmpn_page' ) ) {
342+
return rgget( 'gpmpn_page' );
343+
}
344+
345+
return rgars( $_REQUEST, 'atts/page', $page );
346+
} );
347+
340348
$atts = rgpost( 'atts' );
341349

342350
// GF expects an associative array for field values. Parse them before passing it on.

0 commit comments

Comments
 (0)