Skip to:
Content
Pages
Categories
Search
Top
Bottom

Renaming Group tabs


  • portalpublishing
    Participant

    @portalpublishing

    Each group has tabs for “Home” “Forum” “Members” etc.

    I want to rename the “Home” for all groups to “Activity” instead of “Home”

    I assume this is to be done via functions.php

    Can someone perhaps give me some idea as to what I would need to put in the functions.php file to rename this?

    I’ve tried this:

    /**Function to change the group tab from home to activity **/
    function group_default_tab() {
    global $bp;
    
    $bp->bp_options_nav[$bp->groups->current_group->slug]['Home']['name'] = 'Activity';
    }
    add_action('bp_groups_setup_nav', 'group_default_tab');
Viewing 3 replies - 1 through 3 (of 3 total)

  • Prashant Singh
    Participant

    @prashantvatsh

    Hi,

    Please put this snippet in your child theme’s functions.php:

    function ps_rename_group_tabs() {
     
        if ( ! bp_is_group() ) {
            return;
        }
        
        buddypress()->groups->nav->edit_nav( array( 'name' => __( 'Activity', 'buddypress' ) ), 'home', bp_current_item() );
    }
    add_action( 'bp_actions', 'ps_rename_group_tabs' );

    Hopefully, it will help you.

    Thanks


    portalpublishing
    Participant

    @portalpublishing

    This worked perfectly. Thank you for your help.


    Prashant Singh
    Participant

    @prashantvatsh

    Glad to know that it worked for you 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar