简体   繁体   English

在buddypress中更改管理栏的内容

[英]Change the content of the admin bar in buddypress

I need to change the content of admin bar in the buddypress default template. 我需要更改buddypress默认模板中管理栏的内容。 It has options like My Account, Dashboard, Notifications. 它具有“我的帐户”,“仪表板”和“通知”之类的选项。 First, I want to delete the dashboard option. 首先,我要删除仪表板选项。 Next, I want to show different options for different user types in the 'my account' option. 接下来,我想在“我的帐户”选项中为不同的用户类型显示不同的选项。 eg I have two user types- student and teacher. 例如,我有两种用户类型:学生和教师。 Now, I want a 'friends' option to show for the student, but not for the teacher, in the 'my account' section. 现在,我希望在“我的帐户”部分中为学生而非教师显示“朋友”选项。

To delete Dashboard, try adding this to your functions.php or bp-custom.php: 要删除仪表板,请尝试将其添加到functions.php或bp-custom.php中:

remove_action( 'bp_adminbar_menus', 'bp_adminbar_thisblog_menu', 6);

You should be able to use this to conditionally remove/add menus. 您应该可以使用它有条件地删除/添加菜单。 There's a relevant article here: http://codex.buddypress.org/theme-development/modifying-the-buddypress-admin-bar/ 这里有一篇相关文章: http : //codex.buddypress.org/theme-development/modifying-the-buddypress-admin-bar/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM