• Resolved yoluca

    (@yoluca)


    would like to remove events menu from BuddyPress profile menus …

    i tried

    function my_remove_em_nav() {
    global $bp;
    bp_core_remove_subnav_item($bp->groups->slug,’group-events’);
    bp_core_remove_subnav_item($bp->groups->current_group->slug,’events’);
    }
    add_action( ‘init’, ‘my_remove_em_nav’ );

    but doesnt work ..

    am i doing anything wrong ?

    https://www.ads-software.com/plugins/events-manager/

Viewing 5 replies - 16 through 20 (of 20 total)
  • THANK YOU grantg182!!!

    I’ve been looking for a solution to this for the last four hours and you posted at just the right time. Of all the code snippets I’ve run across to purportedly do this, it’s the only one that’s worked.

    Thread Starter yoluca

    (@yoluca)

    thanks @grantg182 but that code doesnt remove the events tab in buddypress.

    thats in functions.php of my active theme ….

    any idea ?

    thanks

    Yeah, you’re right. I noticed this too. I wasn’t able to find where the controller is for the Events tab in BP, so I did it another way to get rid of that too, not the most elegant of solutions, but it works.

    In your stylesheet (preferably a hooked stylesheet which won’t be modified by a WP/BP update:-

    #events-personal-li {display:none !important;}

    Dirty, but functional.

    Thread Starter yoluca

    (@yoluca)

    Ok .. But thats css .. Which could go in css override…

    Ill give it a go …

    Thanks

    Yep, but you will need to use both the function I posted and the CSS hack because the Events links in the menus do not have any unique identifier (there is to id or class assigned to the ‘li’ nor ‘a’ elements. Due to how tabs work, they must have some unique identifier, therefore you can specifically target the Events tab.

    Unfortunately the only down side of this is that the (Group) Events pages are still accessible if the user finds the URL in the source code in regards to the Events tab, or if they know the URL for the Events link. I haven’t fully investigated the purpose, but if you use the function I posted earlier, the Events/Group Events page are not generated and return a 404 error.

    This should really be an option in the Events settings to disable Group Events. The site I have developed does not use ‘Bookings’, therefore the only purpose for the group Events would be for users to say “I’m attending…XYZ event” without the requirement to have a record in the database for a booking for said event. Alas, the hack works for now.

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘remove Events menu from BuddyPress profile menus’ is closed to new replies.