-
Author
-
June 29, 2017 at 09:04 #165610internetserviceParticipant
hi support, so I am wondering if I am able to create below restrictions in my dating site for those who haven’t upgrade their level using pmpro?
•when a user Try to write a message
•when a user Try to answer a message
•when a user Try to see who have poke them
•when a user Try to see the whole event post.
•when a user Try to take part in “forum” when they click on a post, it should also not be allowed to create a post.so every time a user does any of the above things then the price list membership page would show up instead? essentially buddypress components would not work without paying for the membership level in pmpro? so those free users might need to upgrade their levels to be able to interact with each other using buddypress components.
any idea how to do it?
June 30, 2017 at 04:13 #165730LauraModeratorHello, will assign the ticket to a higher support level who can help and advise you in your query.
Thanks! ?Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
July 4, 2017 at 18:00 #166272RaduModeratorHi,
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 CODEadd_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 solutionJuly 4, 2017 at 18:27 #166282internetserviceParticipantyes, thank you for your help. actually, I had solved it though by joining in the pmpro forum. and by using this code below.
COPY CODEif ( pmpro_hasMembershipLevel() ) { //if the user has a membership level or an admin, show the 'add friend button'. return $button; }
but the code above will hide the button for free users and administrator. so paying members will be able to see the button but it seems that administrator will be imposed the same restrictions as a free user in which the button won’t show up.
so my question is what is the code function that will allow administrator to have the same rights as those paying membership?
any idea?
July 5, 2017 at 13:58 #166354internetserviceParticipantbtw I had solved this problem by using this code.
COPY CODEif( !current_user_can( 'manage_options) ){ if( !pmpro_hasMembershipLevel() ){ return; } }
so you can close this ticket.
thanksJuly 6, 2017 at 15:34 #166504RaduModeratorOk then
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
You must be logged in to reply to this topic.