I’m looking for a way to access all comments authored by a specific user. I know there is a feed for all comments regardless of user (http://example.com/comments/feed/) but is there a way to limit comments to a certain user?
Leave a Reply
You must be logged in to post a comment.
The
get_comments()
function allows you to pass in an array of parameters to filter on – http://codex.wordpress.org/Function_Reference/get_commentsTo get all comments for user_ID 1, you would use:
The result will be an array of comment objects that match your search criteria. You can use multiple filters at once, for example the user ID in conjunction with a status.