Last active
November 26, 2015 02:45
-
-
Save greathmaster/04d28b5ce989ba8f6494 to your computer and use it in GitHub Desktop.
Excludes a category from being counted with PMPro Limit Post Views
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
| function exclude_category_from_pmpro_limit_views() | |
| { | |
| global $post; | |
| if(has_category("events", $post) && is_user_logged_in()) | |
| { | |
| add_filter("pmpro_has_membership_access_filter", "__return_true"); | |
| } | |
| } | |
| add_action("wp", "exclude_category_from_pmpro_limit_views", 5); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment