WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
Remove Events tab from BuddyPress Profile Navigation (11 posts)

  1. kawestphal
    Member
    Posted 2 years ago #

    I am using Events Manager with BuddyPress. I am the only one that will be creating events and users will just be able to view the Events on a page (not be able to create bookings and such). With the install of Events Manager, it creates a tab in a users profile navigation called Events. Is there a way to remove this tab?

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 2 years ago #

    you can try to use User Capabilities to limit user;

  3. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    the above would allow you to limit users to only see events they're attending

    alternatively, you could add this to your theme's functions.php file:

    remove_action( 'bp_include', 'bp_em_init' );

    it'll prevent all BP features from working (including activity feeds etc).

  4. martinft
    Member
    Posted 2 years ago #

    I have the same problem as kawestphal. But I can't find any capabilities to remove the Events tab from BuddyPress profile navigation.
    I've added remove_action to my functions-custom.php (theme frisco-for-buddypress). But that changed nothing.

    Any ideas?
    Thanks in advance!

  5. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    you probably need to insert it into functions.php because that's loaded after EM files are loaded

  6. agelonwl
    Member
    Posted 2 years ago #

    @martinft

    alternatively, you can try this

    function my_remove_em_nav() {
    	global $bp;
    	$bp->bp_nav['events'] = false;
    	bp_core_remove_subnav_item($bp->groups->slug, 'events');
    }
    add_action( 'bp_setup_nav', 'my_remove_em_nav' );
  7. martinft
    Member
    Posted 2 years ago #

    Thanks, agelonwl! Your code works great!

  8. kawestphal
    Member
    Posted 2 years ago #

    Thanks agelonwl! I will say that when I add the code, it removes the Events tab from the Member's Profile Navigation but it leaves a little block instead - a tab with no letters and smaller than the others.

    Martinft, do you by chance get that as well? If not, what version of Buddypress are you using?

  9. agelonwl
    Member
    Posted 2 years ago #

    hi,

    Please try this one instead

    function my_remove_em_nav() {
    	global $bp;
    
    	bp_core_remove_subnav_item($bp->groups->slug,'group-events');
    	bp_core_remove_nav_item( 'events' );
    
    }
    add_action( 'bp_setup_nav', 'my_remove_em_nav' );
  10. kawestphal
    Member
    Posted 2 years ago #

    That one worked perfect agelonwl ... Thanks so much!

  11. snapalot
    Member
    Posted 1 year ago #

    Hi there

    I've tried @aglonwl's code with the line $bp->bp_nav['events'] = false; in my child theme's functions.php but then it doesn't display my menu or anything below that. To be precise, this is what I have:

    function bbg_change_profile_tab_order() {
    	global $bp;
    
    	$bp->bp_nav['profile']['position'] = 10;
    	$bp->bp_nav['activity']['position'] = 20;
    	$bp->bp_nav['friends']['position'] = 30;
    	$bp->bp_nav['messages']['position'] = 40;
    	$bp->bp_nav['achievements']['position'] = 50;
    	$bp->bp_nav['settings']['position'] = 60;
    	// $bp->bp_nav['groups'] = false;
    	// $bp->bp_nav['blogs'] = false;
    	// $bp->bp_nav['forum'] = false;
    	// $bp->bp_nav['events'] = false;
    }
    add_action( 'bp_setup_nav', 'bbg_change_profile_tab_order', 999 );

    The menu order gets modified, but as soon as I remove the comment chars // it breaks.

    I'm using WordPress 3.4.2, Buddypress 1.6.1, Events Manager 5.2.6. Any advice would be appreciated.

    Cheers
    Kobus

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic