Skip to:
Content

BuddyPress.org

Opened 13 years ago

Closed 13 years ago

#3206 closed enhancement (fixed)

Group extensions should be able to register admin and non-admin $name

Reported by: boonebgorges's profile boonebgorges Owned by:
Milestone: 1.6 Priority: minor
Severity: Version: 1.5
Component: Groups Keywords:
Cc:

Description

It should be possible for group extensions to register a separate $admin_name or something like that. For example, I'm building a plugin where I want to have a post count in the group extension tab - something like "Docs (13)". But if I do it that way, then it also shows up on the Group Admin tab. Ideally, these would be separate.

Change History (3)

#1 @r-a-y
13 years ago

+1.

At the moment, I use a workaround where I check the action variable first and then change the name accordingly.

I do this for the "Create A Step" name, but could be easily done with the group admin as well.

// workaround to change the "create a step" name
if ( $bp->action_variables[0] == 'step' ) {
	$this->name = __( 'Name', 'bp-ext' );
}
else {
	$this->name = __( 'Full Extension Name', 'bp-ext' );
}

#2 @boonebgorges
13 years ago

Yeah, except that the same logic won't work for group admin screens, because then you are seeing both the regular tab AND the admin tab at the same time.

I ended up hacking around it by reaching into $bp->bp_options_nav after the value is set but before it's rendered: https://github.com/boonebgorges/buddypress-docs/commit/a559f4b38426dcb54261348155fc46487fff897d#L1R498

Obviously, this is a crappy way of doing things :)

#3 @boonebgorges
13 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [5384]) Introduces admin_slug, admin_name, create_slug, and create_name properties for BP_Group_Extension, to provide for more flexibility in the way that admin and group creation tabs are named in plugins. Fixes #3206

Note: See TracTickets for help on using tickets.