Created
June 16, 2017 11:55
-
-
Save wpflippercode/18f9b3a1205af57b7e7d92b9a0d0fdd8 to your computer and use it in GitHub Desktop.
Set Minimum Age By Category in Age Gate WordPress Plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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