把下面的代码复制到您的主题下面的Functions.php中。
function wpdx_get_comment_list_by_user($clauses) {
if (is_admin()) {
global {
mathJaxContainer[0]}wpdb;
$clauses['join'] = ", wp_posts";
{
mathJaxContainer[1]}user_ID." AND wp_comments.comment_post_ID = wp_posts.ID";
};
return $clauses;
};
if(!current_user_can('edit_others_posts')) {
add_filter('comments_clauses', 'wpdx_get_comment_list_by_user');
}
function bzt_parse_query_useronly( $wp_query ) {
if ( strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin/edit.php' ) !== false ) {
if ( !current_user_can( 'add_user' ) ) {
global $current_user;
{
mathJaxContainer[2]}current_user->id );
}
}
}
add_filter('parse_query', 'bzt_parse_query_useronly' );