Creating group admin submenu
-
Hi all,
I am creating a plugin (which I will release in the repository), that lists former members of a buddypress group. I have 95% of it nutted out.
However when I register the nav menu (which I need to appear in the manage/admin section for the group), it shows in the menu correctly but 404´s when I click on it. My code is below, any help would be appreiated. I am running the latest version of buddypress, wordpress, as multisite)
As I said when I finish the plugin it will go in the repository for everyone to benefit.
public function show_screen_title() {
echo ‘New Tab Title’;
}public function show_screen_content() {
echo ‘New Tab content’;
}public function new_group_tab_screen() {
add_action(‘bp_template_title’, array($this, “show_screen_title”));
add_action(‘bp_template_content’, array($this, “show_screen_content”));$templates = array(‘groups/single/plugins.php’, ‘plugin-template.php’);
if (strstr(locate_template($templates), ‘groups/single/plugins.php’)) {
bp_core_load_template(apply_filters(‘bp_core_template_plugin’, ‘groups/single/plugins’));
} else {
bp_core_load_template(apply_filters(‘bp_core_template_plugin’, ‘plugin-template’));
}}
public function new_nav(){
global $bp;if (isset($bp) and isset($bp->groups->slug) and isset($bp->groups->current_group->slug)){
bp_core_new_subnav_item( array(
‘name’ => __( ‘Former Members’, ‘altctrl-public-group’ ),
‘slug’ => ‘former-members’,
‘parent_url’ => bp_get_groups_action_link( ‘admin’ ),
‘parent_slug’ => $bp->groups->current_group->slug . ‘_manage’,
‘screen_function’ => array( $this, ‘new_group_tab_screen’),
‘user_has_access’ => bp_is_item_admin(),
‘position’ => 40
), ‘groups’ );}
}
- You must be logged in to reply to this topic.