Skip to:
Content
Pages
Categories
Search
Top
Bottom

Group Admin submenu tabs disappear when loading multiple edit_screen() functions in BP_Group_Extensi

  • @crazywhistlepig

    Participant

    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • @djpaul

    Keymaster

    It ought to not happen. Uh.

    They aren’t sharing IDs or any identifiers in the code? (not HTML IDs?)

    @crazywhistlepig

    Participant

    I agree, and no they are not sharing IDs or slugs. I’ve been chasing this issue for months now, and just today realized it had to do with include sequence.

    I’ve also noticed the behaviour in other plugins, such as the BuddyPress Group Email Subscription by Deryk Wenaus, boonebgorges. If that plugin is activated also, it will interact with the tabs from my plugin hiding tabs etc. Low and behold, they too are using the BP_Group_Extension API.

    Wonder if this is a bug? I also tried it with a virgin install of WP and BP and it happens there as well.

    @crazywhistlepig

    Participant

    Also, I’d like to add that the corresponding parent display tabs also disappear from the main group menu when you select tabs in the admin submenu, But work fine (do not disappear) when you select them from the main group menu. Seem like issue only occurs with the function edit_screen() in the admin submenu.

    @yzqiang

    Participant

    I also meet the same problem now. Did you find the solving way?
    I have published a ticket on the below link:
    http://premium.wpmudev.org/forums/topic/buddypress-group-admin-tabs-disappear#post-387034
    Thanks!

    @yzqiang

    Participant

    I found it has been solved in 1.7 already.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Group Admin submenu tabs disappear when loading multiple edit_screen() functions in BP_Group_Extensi’ is closed to new replies.
Skip to toolbar