admin管理员组文章数量:1313962
I don´t clearly understand why this code does not work :
//Front-end profile page
global $current_user;
if ( current_user_can( 'edit_user') ) { ... }
$current_user output : ["allcaps"]=> array(6) { ["read"]=> bool(true) ["level_0"]=> bool(true) ["edit_user"]=> bool(true) ["view_admin_dashboard"]=> bool(true) ["subscriber"]=> bool(true) ["client"]=> bool(true) }
So, that is in the list !
even if I do this :
$role = get_role('client');
$role->add_cap('edit_user');
global $current_user;
if ( current_user_can( 'edit_user') ) { ... }
that does not work as well.
But with the capability 'read', that works perfectly.
Someone can help me and explain what happens ?
本文标签: user rolescurrentusercan( 39edituser39 ) does not work
版权声明:本文标题:user roles - current_user_can( 'edit_user' ) does not work 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741960999a2407278.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论