0

Here is what I have to far that is not working:

function comments_for_current_author($query) {
    global $pagenow;
  
    if( 'edit-comments.php' != $pagenow || !$query->is_admin )
        return $query;
  
    if( !current_user_can( 'edit_others_posts' ) ) {
        
        global $user_ID;
        $query->set('author', $user_ID );
    }
    return $query;
}
add_filter('pre_get_comments', 'comments_for_current_author');

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.