Skip to content

Instantly share code, notes, and snippets.

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 wpflippercode/18f9b3a1205af57b7e7d92b9a0d0fdd8 to your computer and use it in GitHub Desktop.
Save wpflippercode/18f9b3a1205af57b7e7d92b9a0d0fdd8 to your computer and use it in GitHub Desktop.
Set Minimum Age By Category in Age Gate WordPress Plugin
add_filter('agp_current_settings', 'agp_current_settings',1,1);
function agp_current_settings($options) {
if(is_category('beer')) {
$options['min_age'] = 16;
} elseif(is_category('spirits')) {
$options['min_age'] = 18;
}
return $options;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment