Skip to content

Commit 600238d

Browse files
authored
gw-cache-buster.php: Fixed issue with Cache Buster not clearing cookies with Paypal checkout and Nested entry.
1 parent e5b32a0 commit 600238d

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

gravity-forms/gw-cache-buster.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,17 +143,20 @@ public function shortcode( $markup, $attributes, $content ) {
143143
$ajax_url = remove_query_arg( $exclude_params, add_query_arg( $_GET, admin_url( 'admin-ajax.php' ) ) );
144144

145145
// Still needed for the AJAX submission.
146-
$ajax_url = add_query_arg(
147-
array(
148-
'action' => 'gfcb_get_form',
149-
'form_id' => $form_id,
150-
'gpnf_context' => array(
151-
'path' => class_exists( 'GPNF_Session' ) ? esc_js( GPNF_Session::get_session_path() ) : '',
152-
),
153-
),
154-
$ajax_url
146+
$ajax_params = array(
147+
'action' => 'gfcb_get_form',
148+
'form_id' => $form_id,
155149
);
156150

151+
// Ensure AJAX parameters for GPNF are also correctly populated.
152+
if ( class_exists( 'GPNF_Session' ) ) {
153+
$ajax_params['gpnf_context'] = array(
154+
'path' => esc_js( GPNF_Session::get_session_path() ),
155+
);
156+
}
157+
158+
$ajax_url = add_query_arg( $ajax_params, $ajax_url );
159+
157160
$lang = null;
158161
if ( class_exists( 'Gravity_Forms_Multilingual' ) ) {
159162
global $sitepress;

0 commit comments

Comments
 (0)