This topic has 4 replies, 3 voices, and was last updated 7 years by Radu.

  • Author
  • #167959
     allana
    Participant

    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.

    #168010
     Laura
    Moderator

    Hello, 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 solution

    Laura 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 🙂

    #168205
     Radu
    Moderator

    hi

    Use the next function to remove completely messages tab if the user doesn’t have any membership package.

    COPY CODE
    
    function 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 CODE
    
    function 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 solution
    #168212
     allana
    Participant

    Radu, 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

    #168457
     Radu
    Moderator

    Hi,

    I see in this case

    Use the next function instead

    COPY CODE
    
    
    function 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

    dev@seventhqueen.com

    Cheers
    R

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?