You can use this hook: do_action( 'bp_directory_groups_item' );
For example, this will display a link to the first admin for each group:
function diego_add_group_admin_info() {
$group_id = bp_get_group_id();
$group_admins = groups_get_group_admins( $group_id );
$admin_id = $group_admins[0]->user_id;
echo bp_core_get_userlink( $admin_id );
}
add_action( 'bp_directory_groups_item', 'diego_add_group_admin_info' );
thank you very much, you have helped me so much.
it works correctly, however has appeared in editors page (when I add the code that you wrote and after I click on update) the next error text.
“Something went wrong. Your change can not be saved. Please try again. You may also have to fix it manually and upload the file via http://FTP.”
so thank you very much!
WP no longer allows you to add code in the editor unless it can test the code first – otherwise it throws that error.
You should not be adding the code in that location.
You should add it to bp-custom.php or to the functions.php file in your theme or child theme.
hello, I’ve just tried adding the code on functions.php, but when i’ve opened it, the code has apeared in the section custom functions (where I added it before, using the wordpress theme editor). That’s why I don’t inderstand the error…and your hook also works perfectly, in spite of that error. Anyway I’ve done what you said, and have added it on function.php
thank you again.