Skip to content

Instantly share code, notes, and snippets.

@timersys
Created April 13, 2020 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timersys/cf4b78d76dc7da8aab83679e4f251fb5 to your computer and use it in GitHub Desktop.
Save timersys/cf4b78d76dc7da8aab83679e4f251fb5 to your computer and use it in GitHub Desktop.
Tiny plugin to enable State cache to Wp Rocket + GeotargetingWP
<?php
/**
* Plugin Name: Wp Rocket + GeotargetingWP States
* Plugin URI: https://geotargetingwp.com
* Description: Enable states cache for WPRocket.
* Author: timersys
* Author URI: https://geotargetingwp.com
*/
/**
* By default WpRocket plugin will create different cache pages at a country level
* To add more levels (states or cities) you need to add the following filter
*/
add_filter('rocket_geotargetingwp_enabled_cookies', function($enable){
$enable[] = 'state';
//$enable[] = 'city';
return $enable;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment