Support » Fixing WordPress » List all comments from one user

  • Resolved julianislief

    (@julianislief)


    Hello,

    Is it possible to list all comments from one specific user?
    I googled around and don’t get any answers to this simple question!

    Regards,
    Geert

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    Try it with this:

    <?php
    $args = array(
    	     'user_id' => 1, // change to specific user ID
    	     'status' => 'approve'
    	     );
    $comments = get_comments($args);
    foreach($comments as $comment) : ?>
    <h2><?php echo $comment->comment_author; ?></h2>
    <p><?php echo $comment->comment_content ?></p>
    <?php endforeach; ?>

    Thread Starter julianislief

    (@julianislief)

    Thank you so much!

    Moderator keesiemeijer

    (@keesiemeijer)

    You’re welcome.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘List all comments from one user’ is closed to new replies.