By default Wordpress shows all the all accounts the site has already received.
I wanted when logged in as Autor
only displayed comments made on Autor
posts.
See:
The comments with green outline are those that were made in posts created by my account of Autor
the rest are comments made in posts of other Autores
.
What I wanted was to show only the comments made in my posts.
Does anyone know of any PLUGIN that does this?
I searched a lot on the internet and found nothing useful.
Ifoundthis Topic that contains the following code:
# ------------------------------------------------------------
# Ensure that non-admins can see and manage only their own comments
# ------------------------------------------------------------
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');
}
I put it in functions.php
but simply add all comments:
It does not work.