• Resolved rachelflara

    (@rachelflara)


    Hello,

    Is there any way to hide the created profile menu from a specific role?

    Thanks.

    Rachel

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Nahid Ferdous Mohit

    (@nfmohit)

    Hi there, @rachelflara !
    I hope you are having a great day!

    Thank you very much for your query. Unfortunately, it is not possible to hide a profile menu item from a specific role out of the box. However, this really sounds like a very nice idea for the plugin which is why I’ve added it as a feature request. I hope I can come up with this soon in an update.

    In the meantime, you can use a code snippet like this:

    function exclude_tab(){
        global $bp;
        if ( bp_current_user_can( 'contributor' ) ) {
            bp_core_remove_nav_item( 'test' );
        }
    }
    add_action( 'bp_init', 'exclude_tab', 15 );

    In the above example, you can replace contributor with your preferred user role and test with the slug of your preferred profile menu item.

    Hope this helps.

    Regards,
    Nahid

    Plugin Author Nahid Ferdous Mohit

    (@nfmohit)

    Hey there @rachelflara !
    Hope you are doing well today!

    Since it has been over a week and I haven’t heard back from you, I’m assuming that the requirement was fulfilled so I’m going to mark this topic as resolved for now. Please feel free to re-open this if you’d like to continue the discussion.

    Thanks!

    Kind regards,
    Nahid

    Thread Starter rachelflara

    (@rachelflara)

    Hello Nahid,

    The problem was solved. Your code worked perfectly.

    Thanks.

    Rachel

    Plugin Author Nahid Ferdous Mohit

    (@nfmohit)

    Hi Rachel ( @rachelflara )!
    I hope you are doing well today!

    I’m glad to hear that the code worked for you! If this plugin was useful to you, I’d really appreciate if you could share your feedback regarding the plugin in the form of a review so that it can help other users seeking a similar solution.

    Kind regards,
    Nahid

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Hide tab from a specific role’ is closed to new replies.