Opened 10 years ago
Closed 10 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)
Change History (9)
#2
in reply to:
↑ 1
@
10 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()
#3
follow-up:
↓ 4
@
10 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
@
10 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
Big +1 to the idea. A nice improvement. A couple thoughts:
register_post_type()
).bp_core_new_subnav_item()
. Then later we don't have to doempty
checks - justif ( $menu['show_in_admin_bar'] )
.