0. 安装 WPLMS Customizer 插件
1. WP后台 -> 插件- >编辑 -> wplms customizer -> customizer_class.php
2. 添加下面代码到 _construct 函数:
add_action('bp_member_options_nav',array($this,'wplms_bp_member_options_nav'));
function wplms_bp_member_options_nav(){
echo '<li id="settings-custom-li"><a id="custom-settings" >MyCustom Anchor</a></li>';
}
可选: 基于角色的菜单链接:
3.基于角色的左侧菜单链接。考虑以下示例
add_action('bp_member_options_nav',array($this,'wplms_bp_member_options_nav'));
function wplms_bp_member_options_nav(){
if(is_user_logged_in()){ // Detects is user is logged in
if(current_user_can('edit_posts')){ // Detects Instructors and Administrators
echo '<li id="settings-custom-li"><a id="custom-settings" >MyCustom Anchor</a></li>';
}
}
}