-
Author
-
July 19, 2017 at 18:28 #167959allanaParticipant
In the theme options it is possible to restrict the composing of private messages by membership level.
Do you know the code that can also restrict the viewing of private messages by membership level please?
Given this is one of the most basic ways to monetise the theme I am quite suprised it is not included as standard.
July 20, 2017 at 00:32 #168010LauraModeratorHello, 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 21, 2017 at 17:13 #168205RaduModeratorhi
Use the next function to remove completely messages tab if the user doesn’t have any membership package.
COPY CODEfunction remove_buddypress_tabs_by_membership() { if( ! pmpro_has_membership_access()) { bp_core_remove_nav_item('messages'); } add_action( 'bp_init', 'remove_buddypress_tabs_by_membership', 999 );
Or the next one to remove that only for a certain memebrship level in my example it’s with package id 1
COPY CODEfunction remove_buddypress_tabs_by_membership() { if(pmpro_hasMembershipLevel('1')) { bp_core_remove_nav_item('messages'); } } add_action( 'bp_init', 'remove_buddypress_tabs_by_membership', 999 );
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJuly 21, 2017 at 17:31 #168212allanaParticipantRadu, thanks for looking at this ,it is appreciated.
What I am trying to achieve is for all types of members to be able to send messages, but only paying members to be open and view a message.
If we remove the messages tab completely for non-payment members then this means they cannot send a message, or see when one has arrived (which I would like them to be able to).
There is already an option in the buddypress settings that allows for restricting sending messages. Could we use a similar code for restricting viewing them, without removing the tab?
Kind regards
Allan
July 24, 2017 at 18:34 #168457RaduModeratorHi,
I see in this case
Use the next function instead
COPY CODEfunction remove_buddypress_tabs_by_membership_css() { echo' <style> .bbp-user-page #item-body .messages { display: none; } </style> '; } add_action( 'wp_head', 'remove_buddypress_tabs_by_membership_css', 999 );
This will hide via CSS the messages container if you need to hide that via PHP and displaying a message there it requires more time and it’s something custom since our support team cannot cover custom development but guidance yes.
You can ask our development team about a price quote for this
Cheers
RHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.