Currently, we have functions like openlab_group_membership_tabs(), which certain BP subnavs. These functions are then called across multiple single-group templates. This makes it hard to customize or extend the nav items: you can fork openlab_group_membership_tabs(), but then you have to override each of the functions that call the tabs.
Let's make this easier. In an ideal world, we'd use BP functions to register and spit out nav menus in a proper way. This would require a pretty extensive rewrite. But we can make the more modest improvement of moving the markup into a template file. Maybe something like this:
Move the guts of openlab_group_membership_tabs() into a file openlab-theme/buddypress/groups/single/tabs-membership.php
In openlab_group_membership_tabs(), use bp_get_template_part() to load the new template
Do something similar for other similar functions
It'd be more transparent to call bp_get_template_part() directly from the template files, but this would require changes across lots of theme templates, which increases the chances that the change won't be picked up by custom child themes. The approach sketched above should be 100% backward-compatible.
Currently, we have functions like
openlab_group_membership_tabs()
, which certain BP subnavs. These functions are then called across multiple single-group templates. This makes it hard to customize or extend the nav items: you can forkopenlab_group_membership_tabs()
, but then you have to override each of the functions that call the tabs.Let's make this easier. In an ideal world, we'd use BP functions to register and spit out nav menus in a proper way. This would require a pretty extensive rewrite. But we can make the more modest improvement of moving the markup into a template file. Maybe something like this:
openlab_group_membership_tabs()
into a fileopenlab-theme/buddypress/groups/single/tabs-membership.php
openlab_group_membership_tabs()
, usebp_get_template_part()
to load the new templateIt'd be more transparent to call
bp_get_template_part()
directly from the template files, but this would require changes across lots of theme templates, which increases the chances that the change won't be picked up by custom child themes. The approach sketched above should be 100% backward-compatible.