Giving access to non-admin roles


#1

Anyone in the Administrators role can view any locked post. Is it possible to configure the plugin so that users in the Author, Editor, or Contributor roles can view locked posts?


#2

Currently there isnt a way to easily do that via options. You could do it through code modifications.


#3

I started adding some code to my own plugin to accomplish this. I looked through the source and I saw the “ptrn/bypass_filtering” filter. Is this what I should be hooking into? Do you have any samples of how to use this?

My attempt so far is this (with pseudocode):

function patreon_bypass_filtering( $filter ) 
{
    if ( !$filter )
    {
        if ( <User is Author> )
        {
            return true;
        }
    }

    return $filter;
}
add_filter( "ptrn/bypass_filtering", "patreon_bypass_filtering", 10, 1 );

#4

Thats a good way of doing it…