将此代码放入wp管理/编辑注释中。php
function myplugin_get_comment_list_by_user($clauses) {
if (is_admin()) {
global $user_ID, $wpdb;
$clauses[\'join\'] = ", wp_posts";
$clauses[\'where\'] .= " AND wp_posts.post_author = ".$user_ID." AND wp_comments.comment_post_ID = wp_posts.ID";
};
return $clauses;
};
// ensure that editors and admins can moderate everything
if(!current_user_can(\'edit_others_posts\')) {
add_filter(\'comments_clauses\', \'myplugin_get_comment_list_by_user\');
}