Skip to content

Instantly share code, notes, and snippets.

@zackkatz
Created October 6, 2017 18:20
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 zackkatz/354a71dc47ffef072ed725706cf455ed to your computer and use it in GitHub Desktop.
Save zackkatz/354a71dc47ffef072ed725706cf455ed to your computer and use it in GitHub Desktop.
GravityView - Disable setting cookies on front-end of site
<?php
add_filter( 'gravityview_js_localization', 'gravityview_disable_frontend_cookies' );
/**
* Disable setting cookies for back links on the front-end of the site
*
* Requires GravityView 1.22.1
*
* @param array $js_localization Settings for JS, including cookie path
*
* @return array $js_localization, without cookie path
*/
function gravityview_disable_frontend_cookies( $js_localization ) {
unset( $js_localization['cookiepath'] );
return $js_localization;
}
@asiainorama
Copy link

Please, can you explain for newbies where to add this code?
I have problems with cookies because gravity views doesn't show the changes when edit forms.
In adittion, I've installed this plugin https://github.com/katzwebservices/gv-snippets/archive/addon/2863-disable-cache.zip but doesn't solve the problem.
Thanks in advance.

@zackkatz
Copy link
Author

@asiainorama Please check out this article for where to add code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment