Tagged: Custom button, profile
Hello,
so I follow this tutorial https://buddydev.com/support/forums/topic/how-to-add-custom-buttons-to-buddypress-profile-page/ to add a custom button, it’s working but the button gets added to the far right or last option, I’d like to reposition the button to the far left or first option. How can achieve this? TY!
Hi Omar,
Thank you for the question.You can change the priority.
For example, instead of this lineadd_filter( 'bp_nouveau_get_members_buttons', 'buddydev_add_custom_buttons' );
you can use this
add_filter( 'bp_nouveau_get_members_buttons', 'buddydev_add_custom_buttons', 0 );
Please give it a try.
Regards
BrajeshHi Omar,
which theme and template pack are you using? Also, are you using anything like Youzer?Regards
BrajeshHi Omar,
I am sorry, The code will not work with BuddyBoss. It does not matter at what priority you attach it as they first generate markup for their enabled buttons and then append then buttons hooked at ‘bp_member_header_actions’.Please get in touch with BuddyBoss support and see if they can help. You might need a different hook.
Regards
BrajeshHi Omar,
sure.You can use something on this line in the code where you are generating button
$user = get_user_by( 'id', bp_displayed_user_id() ); if ( in_array( 'subscriber', $user->roles ) ) { // some button } elseif ( in_array( 'contributor', $user->roles ) ) { //some other button ... } // and so on..
Hope you can adapt it.
Regards
Brajesh
You must be logged in to reply to this topic.