create new create group tab
-
I use: wp Version 5.1.1
buddypress 4.2.0
KLEO THEME Version 4.4.7
ext: wpml Version 4.2.4.1 + iFlyChat Version 4.6.1
web url: https://austrialandscapes.com/en/members/austrialandscapes/groups/Dear User!
Hmm ……, somehow my last 2 entries did not come true! Anyway, I’ll try again!
I want to create an additional tab under the profile group section. I’ve looking for a solution since weeks now! Besides a docent of useless plugins on stackoverflow I could find a code snipped like this:
//Create new Group tab (neue Gruppe erstellen) 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 );
I added it to the buddypress_functions.php, but it neither worked out! Maybe the code is obsolete, because its from 2011!
Is there really no damn way to add such a stupid extra tab into the Group section, as shown in this screenshot ?
Even this forum seems to be very lame, I still hope there’S someone smart out there to help me solving this issue!
-
somehow it didn’t take the url of the screenshot! here it is again: https://ibb.co/rfQ6W1b
Which buddypress_functions.php file are you talking about? I’d have thought you’d put it in your themes functions.php file or a bp-custom.php file located in the plugins directory.
Also I’d load it in the action hook ‘bp_setup_nav’, not ‘wp’.
Hi Venutius, thank you for your reply! I meant the file, inside the buddypress files directory (screenshot: https://ibb.co/bgFfSgr).
About you’re saying:Also I’d load it in the action hook ‘bp_setup_nav’, not ‘wp’.
Did you mean changing the line
add_action( 'wp', 'groups_subnav_hook', 2 );
to
add_action( 'bp', 'groups_subnav_hook', 2 );
?Thanx very much for help (y) !
no,
add_action( 'bp_setup_nav', 'groups_subnav_hook' );
You should add customisations either in your themes function.php or in a bp-custom.php file placed in the plugins directory.
Hi Venutius,
hmmm … meanwhile I tried to figure the file you suggested; Under the theme files, I foud the “function.php” – file (screenshot: https://ibb.co/YDw7LN5). But there’s no buddypress menu, where I could add this code snipped. Maybe I’m totally wrong here! Please, could you be more precise, so I could follow your advise?
thank you very much in advance and best Regards!
1. set up a child theme.
2. inside the childtheme directory there will be a functions.php file.
3. place your custom code in there.
- You must be logged in to reply to this topic.