下面是一个通过CSS隐藏“编辑”链接的方法:
function wpse85434_hide_editlinks() {
if(!current_user_can(\'manage_options\')){
// only for non-admins
echo "<style>.misc-pub-section .edit-timestamp{display:none !important;} </style>";
}
}
add_action(\'admin_head-post.php\',\'wpse85434_hide_editlinks\');
add_action(\'admin_head-post-new.php\',\'wpse85434_hide_editlinks\');
我使用
!current_user_can(\'manage_options\')
因此,它将对管理员可见。
之前:

之后:
