"Events" Admin Bar Menus Appear for Subscriber User Role

Home Forums Calendar Products Events Calendar PRO "Events" Admin Bar Menus Appear for Subscriber User Role

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #161585
    Robert Staddon
    Participant

    When a user with the “Subscriber” role logs into my site through the WordPress Admin (to update his profile, for example) he sees an empty “Events” link on the WordPress admin sidebar. He also sees an “Events” link on the top admin bar. Clicking on “Events” in either case leads to a page that says “You do not have sufficient permissions to access this page.” These should not appear at all for users with the “Subscriber” role.

    #162901
    Casey D
    Member

    Hello robertstaddon,

    Thanks for contacting us! I agree that can be a bit distracting! I’ll talk to the devs to see if that was intentional.

    In the mean time, this forum post should point you in the right direction https://theeventscalendar.com/support/forums/topic/hide-events-submenu/

    Unfortunately that level of customization typically goes beyond the scope of the forums. However, I think I was able to figure it out pretty quickly. If you put this code in your theme’s functions.php file, it should do what you are looking for. I tested it and it seems to work.

    function tw_remove_menu_pages() {
    if ( current_user_can( ‘administrator’ ) ) return;
    remove_menu_page( ‘edit.php?post_type=tribe_events’ );
    }

    add_action( ‘admin_menu’, ‘tw_remove_menu_pages’, 999 );

    Does this make sense? Let me know if this doesn’t work for you.

    Cheers!

    – Casey Driscoll

    #164936
    Robert Staddon
    Participant

    Thanks, Casey. That was helpful!

    I would be curious to know if this was intentional by the devs. I would guess it’s an oversite. I have dozens of plugins installed adding quite a few items to the sidebar admin menu (e.g. bbPress, WooCommerce, W3 Total Cache, BackWPup Pro, Gravity Forms, etc.) and this was the *only one* that provided an empty menu item to folks in the Subscriber role. All the other menu items quietly disappeared for Subscribers.

    Thanks again!

    #167822
    Casey D
    Member

    Hello robertstaddon,

    I believe we are releasing a fix for this in the upcoming or next release.

    I’ll go ahead and close this thread. Let us know if we can help with anything else!

    Cheers!

    – Casey Driscoll

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘"Events" Admin Bar Menus Appear for Subscriber User Role’ is closed to new replies.