正在载入...

// ===== remove edit profile link from admin bar and side menu and kill profile page if not an admin
if( !current_user_can('activate_plugins') ) {
function mytheme_admin_bar_render() {
    global $wp_admin_bar;
    $wp_admin_bar->remove_menu('edit-profile', 'user-actions');
}
add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' );

function stop_access_profile() {
if(defined('IS_PROFILE_PAGE') && IS_PROFILE_PAGE === true){
 wp_die( 'Please contact your administrator to have your profile information changed.' ); } remove_menu_page( 'profile.php' ); remove_submenu_page( 'users.php', 'profile.php' ); } add_action( 'admin_init', 'stop_access_profile' ); }

本文链接:

关键词:WordPress, 个人资料, 代码, 管理员,

(全文完        )

Comments

哈哈,沙发有木有?!!!抢沙发快速评论

你需要 登录 才可以回复.