BuddyPress:缺少“创建组”按钮

时间:2011-03-29 14:32:29

标签: button buddypress

我的自定义好友按主题缺少“创建群组”按钮。其他一切都有效。知道为什么吗?

1 个答案:

答案 0 :(得分:2)

我实际上认为这只是他们在核心文件中遗漏的东西。我用钩子创建了一个新的:

function groups_subnav_hook() {
    global $bp;

    $groups_link = $bp->loggedin_user->domain . $bp->groups->slug . '/';

    bp_core_new_subnav_item( array(
        'name' => 'Create New Group' ,
        'slug' => 'create',
        'parent_slug' => $bp->groups->slug,
        'parent_url' => $groups_link,
        'position' => 10,
        'screen_function' => 'groups_screen_group_members',
        'user_has_access' => bp_is_my_profile() // Only the logged in user can access this on his/her profile
    ) );
}
add_action( 'wp', 'groups_subnav_hook', 2 );
add_action( 'admin_menu', 'groups_subnav_hook', 2 );