Skip to:
Content

BuddyPress.org

Opened 6 years ago

Closed 6 years ago

#6002 closed enhancement (fixed)

Use the Group Manage options "new" nav to build the WP Admin Bar current group's edit links

Reported by: imath Owned by: imath
Milestone: 2.2 Priority: normal
Severity: normal Version:
Component: Groups Keywords: has-patch commit
Cc:

Description

Now that #5994 is building a "manage" subnav, i was wondering if we could take benefit of it to build the different edit links of the current group's WP Admin Bar menu.

This would avoid doing checks we have already done in the groups component loader class in bp_groups_group_admin_menu() and would allow Groups extension to add their own links to this menu if using the param 'in_admin_bar' (or another one if this name is not ok)

The group extension part can be removed if you think it's not a good idea to let plugins populate this menu. But i think it would be convenient for core menus (especially for what i'm actually working on for the attachments component).

See the attached patch.

Attachments (3)

6002.patch (6.6 KB) - added by imath 6 years ago.
6002.02.patch (9.4 KB) - added by imath 6 years ago.
6002.03.patch (10.0 KB) - added by imath 6 years ago.

Download all attachments as: .zip

Change History (9)

@imath
6 years ago

#1 follow-up: @boonebgorges
6 years ago

  • Keywords 2nd-opinion removed

Big +1 to the idea. A nice improvement. A couple thoughts:

  • Let's go with 'show_in_admin_bar' for the param name. This aligns better with core functions (like 'show_in_ui' for register_post_type()).
  • Go ahead and set 'show_in_admin_bar' in all cases in bp_core_new_subnav_item(). Then later we don't have to do empty checks - just if ( $menu['show_in_admin_bar'] ).
  • You're changing the CSS ids. Is this going to cause backward compatibility issues with existing themes?

#2 in reply to: ↑ 1 @imath
6 years ago

Replying to boonebgorges:

  • You're changing the CSS ids. Is this going to cause backward compatibility issues with existing themes?

Thanks for your feedback :)

Oops, yes you're right: there's a risk. So let's avoid it! In 6002.02.patch, css ids are the same than before, i've changed the param name to "show_in_admin_bar" and set the 'show_in_admin_bar' param in bp_core_new_subnav_item()

@imath
6 years ago

#3 follow-up: @boonebgorges
6 years ago

This is looking good, imath. One last request: please add the param to the docblock of bp_core_new_subnav_item(). You've added some explanation in the default argument array, but the docblock should be the canonical source of documentation for function arguments.

#4 in reply to: ↑ 3 @imath
6 years ago

Replying to boonebgorges:

the docblock should be the canonical source of documentation for function arguments.

No problem, sorry i forgot it. Just added it in 6002.03.patch

@imath
6 years ago

#5 @boonebgorges
6 years ago

  • Keywords commit added

Cool, this is looking good.

#6 @imath
6 years ago

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

In 9131:

Improve Group's Edit WP Admin Bar menu

Use the group's manage options nav to populate the different edit links of the group's Edit WP Admin Bar.
Introduce a new parameter show_in_admin_bar for the edit screen property of the Group Extension API to allow plugins add their edit link into this Admin Bar (if this parameter is set to true).

props boonebgorges

Fixes #6002

Note: See TracTickets for help on using tickets.