WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Disabling Groups' Events in Buddypress (6 posts)

  1. lazyazian
    Member
    Posted 2 years ago #

    Is there a way to only disable Events for Groups? I don't want to disable events site-wide, but I do want to disable Events that are only for Groups.

    I've done a search and came across these 2 options that don't work:

    1.) Inputting these 2 codes (separately and together) into my theme's functions.php (I'm using Site5.com's Wisebusiness theme)
    remove_action( 'bp_init', 'bp_em_init' );
    remove_action( 'bp_include', 'bp_em_init' );

    2.) into theme's functions.php
    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' );

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

  2. agelonwl
    Member
    Posted 2 years ago #

    try these

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

    sorry, use these instead

    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' );
  4. lazyazian
    Member
    Posted 2 years ago #

    Thanks @agelonwl! That works perfectly!

  5. angslycke
    Member
    Posted 2 years ago #

    @agelonwl Thank you so much! This saved my day. I'm not a programmer but as far as I understand, this simply removes the navigation link in the BuddyPress Group pages? If I want to disable the part of Events Manager that handles BuddyPress groups/events I would have to use some other code, right?

    I found the thread below where the plugin creator answered but didn't manage to get that code working. Does it need to be more than:

    remove_action( 'bp_init', 'bp_em_init' );

    See: http://wordpress.org/support/topic/plugin-events-manager-disable-events-on-buddypress

    Thanks!

  6. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    @angslycke that should do it, that's the entry point for loading BP stuff

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic