July 4, 2017 at 18:00
#166272
Moderator
Hi,
All theme available restrictions options are located under wp-admin -> theme options -> memberships.
If you need any other restriction on certain action other than it’s listed in the theme options you should hire a develop those for you since they require dedicated time.
Here it’s a snippet that maybe will help you in future
COPY CODE
add_action( 'template_redirect', 'my_membersip_restrict' );
function my_membersip_restrict() {
global $pmpro_pages, $post;
if ( is_user_logged_in() && !pmpro_hasMembershipLevel() ) {
if (isset($post->ID) && !in_array($post->ID, $pmpro_pages) ) {
wp_redirect( pmpro_url() );
}
}
}
This code will check if logged in user have any membership and if not will be redirected to the pmpro levels page to buy access.
Cheers
R.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Ticket solution