Plugin: BuddyPress ScholarPress Courseware

Join this plugin group to follow comments, support topics and reviews.

Hiding Groups Menus (2 posts)

Started 5 months ago by: karthikskr

  • Profile picture of karthikskr karthikskr said 5 months ago:

    Hi,
    Thanks for this great courseware plugin.

    I am using Wordpress 3.2.1 and Buddypress 1.5.1

    I have been trying to hide the groups tab with the below function.

    function hide_group_menus(){
        global $bp;
        // Check if Courseware is enabled
        if( !defined( 'BPSP_VERSION' ) )
            return;
    
        if( !bp_group_is_admin() ) {
            // hide main 'noisy' menus
            $bp->bp_options_nav['groups'] = $bp->bp_options_nav['groups']->courseware; 
    
            if( $bp->current_component == $bp->groups->slug && $bp->current_action != $bp->courseware->slug )
                // go directly to Courseware tab
                bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . $bp->courseware->slug );
        }
    }
    
    add_action( 'wp', 'hide_group_menus' );
    

    But i can’t fix it.

    Please help me in this

  • Profile picture of Stas SuČ™cov Stas Suscov said 4 months, 4 weeks ago:

    Please take a look at this snippet of code

    https://gist.github.com/1510284