WordPress Membership Plugin
Thanks both, I had spent a long time in that file before posting a request for help. I wasn’t sure how I could avoid erasing the existing data, but I re-read and noticed that the line
\SwpmPermission::get_instance( 2 )->apply( array( $post_id ), 'post' )->save();
Must have done it, so posting it here it helps other people.
Note this code is using PSR-4 (the slash)
This is using default members only access (the 2 after get instance).
Post_id is the id of the post i’ve made and ‘post’ is the post type which I have fixed as it’s always a post for members only.
Thanks again