Skip to content

Commit fadae2d

Browse files
authored
gpnf-get-session-hash.php: Updated to use new(ish) GPNF_Session::get_runtime_hashcode().
1 parent 294e683 commit fadae2d

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

gp-nested-forms/gpnf-get-session-hash.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,8 @@
1010
* call this function before the `gpnf_session_script_data` filter is called.
1111
*/
1212
function gpnf_session_hash( $form_id ) {
13-
1413
$session = new GPNF_Session( $form_id );
15-
$cookie = $session->get_cookie();
16-
17-
if ( empty( $cookie ) ) {
18-
$hash = $session->make_hashcode();
19-
add_filter( "gpnf_session_script_data_{$form_id}", function( $data ) use ( $hash ) {
20-
$data['hash'] = $hash;
21-
return $data;
22-
} );
23-
} else {
24-
$hash = $cookie['hash'];
25-
}
26-
27-
return $hash;
14+
return $session->get_runtime_hashcode();
2815
}
2916

3017
/**

0 commit comments

Comments
 (0)