Skip to content

Instantly share code, notes, and snippets.

@KaineLabs
Last active January 3, 2024 01:32
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaineLabs/c6f6477c43909aa5b81966e7edb1f64d to your computer and use it in GitHub Desktop.
Save KaineLabs/c6f6477c43909aa5b81966e7edb1f64d to your computer and use it in GitHub Desktop.
Add "Create New Group" Into Profile Groups Tab.
<?php
/**
* Add "Create New Group" Into Groups Tab.
*/
function yzc_add_create_new_group_button() {
if ( bp_is_active( 'groups') && bp_user_can_create_groups() && bp_is_user() ) {
bp_core_new_subnav_item( array(
'slug' => "create",
'name' => __( 'Create New Group', 'youzer' ),
'parent_slug' => 'groups',
'parent_url' => bp_get_groups_directory_permalink(),
'screen_function' => 'yz_get_profile_settings_page',
)
);
}
}
add_filter( 'bp_setup_nav', 'yzc_add_create_new_group_button' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment