Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: How to overwrite a function?


Boone Gorges
Keymaster

@boonebgorges

@heini – If you overwrite the existing bp_core_new_nav_default line in bp-groups.php with

bp_core_new_nav_default( array( 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_forum', 'subnav_slug' => 'forum' ) );

it will work.

I can’t seem to make bp_core_new_nav_default work anywhere else. Maybe someone else has some ideas, or maybe it’s just not part of the API to override this right now (like it is with profiles and BP_DEFAULT_COMPONENT).

Another way to do it, which is less elegant but possible without hacking core files, is to put something like this in your bp-custom.php file:

function redirect_to_forum() {
global $bp;

if ( bp_is_group_home() )
$bp->current_action = 'forum';
}
add_action( 'bp_init', 'redirect_to_forum' );

Skip to toolbar