Group Admin submenu tabs disappear when loading multiple edit_screen() functions in BP_Group_Extensi
-
I’m using WordPress 3.3.1 and Buddypress 1.5.4 and have written a group extension plugin following the Group Extension API at http://codex.buddypress.org/developer-docs/group-extension-api/ . I load up my plugin core in my loader.php such as:
`function vhm_plugin_init() {
require ( dirname( __FILE__ ) . ‘/includes/vhm-core.php’ );
}
add_action( ‘bp_include’, ‘vhm_plugin_init’ );`Then in the vhm-core.php I load my include files. Each include file contains one BP_Group_Extension() class:
`require ( dirname( __FILE__ ) . ‘/vhm-control.php’ );
require ( dirname( __FILE__ ) . ‘/vhm-events.php’ );
require ( dirname( __FILE__ ) . ‘/vhm-service.php’ );`Each group extesnion class has a display screen and an edit screen. When in the Group Admin Menu, and I click on an edit tab, the admin submenu changes showing only those tabs prior to the selected tab in the include/require order above. Any tabs that were loaded after the selected one disappear. So for example, im in a specific group as an admin, and go to the admin menu. I see “Details | Settings | Avatars | Members | Control | Events | Service” in the admin submenu (details -> members is part of Buddypress obviously, the other menus are generated from the function edit_screen() for each class in my plugin). If I click on service, the menu is “Details | Settings | Avatars | Members | Control | Events | Service” when I click on Events the menu is “Details | Settings | Avatars | Members | Control | Events” when I click on control the menu is “Details | Settings | Avatars | Members | Control” and when I click on any of the buddypress tabs ( Details | Settings | Avatars | Members) I see the full submenu again. Seems like loading multiple BP_Group_Extension classes in one plugin results in a last one selected is last one loaded. It definitely follows the order of the includes in my vhm-core.php.
Is this expected behavior? Is it not intended to load multiple edit_screen() functions in my class extensions? The weird thing is, that the function display() portion works fine. In other words, when I go to each item in the main group tabs (outside the admin menu) this does not happen. Only in the admin submenu do tabs disappear.
- The topic ‘Group Admin submenu tabs disappear when loading multiple edit_screen() functions in BP_Group_Extensi’ is closed to new replies.