Skip to content

Instantly share code, notes, and snippets.

@labsecrets
Forked from strangerstudios/gist:3845777
Last active August 29, 2015 14:06
Show Gist options
  • Save labsecrets/f8b968ad90dccfd1c2d8 to your computer and use it in GitHub Desktop.
Save labsecrets/f8b968ad90dccfd1c2d8 to your computer and use it in GitHub Desktop.
/*
Set levels as "all access levels" so members of these levels will be able to view all Addon Packages.
Requires Paid Memberships Pro and the pmpro-addon-packages plugin.
*/
function my_pmproap_all_access_levels($levels, $user_id, $post_id)
{
//I'm just adding the level, but I could do some calculation based on the user and post id to programatically give access to content
$levels = array(16);
return $levels;
}
add_filter("pmproap_all_access_levels", "my_pmproap_all_access_levels", 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment