将此代码插入主题函数。php文件:
add_action(\'bulk_actions-edit-comments\', \'author_remove_comments_actions\');
add_action(\'comment_row_actions\', \'author_remove_comments_actions\');
function author_remove_comments_actions($actions) {
if (!current_user_can(\'moderate_comments\')) {
if (isset($actions[\'delete\'])) {
unset($actions[\'delete\']);
}
if (isset($actions[\'trash\'])) {
unset($actions[\'trash\']);
}
if (isset($actions[\'spam\'])) {
unset($actions[\'spam\']);
}
if (isset($actions[\'edit\'])) {
unset($actions[\'edit\']);
}
if (isset($actions[\'quickedit\'])) {
unset($actions[\'quickedit\']);
}
if (isset($actions[\'approve\'])) {
unset($actions[\'approve\']);
}
if (isset($actions[\'unapprove\'])) {
unset($actions[\'unapprove\']);
}
}
return $actions;
}