Show only the comments made in the author's posts

0

I would like to know how to make this code that I found in the WordPress forum only display comments made on user posts ( authored logon ) in WordPress .

I want to display this list in footer and I already use the is_user_logged_in() function in my footer , however it is to make the following code list only the recent posts comments of the logged in user. Here is the code:

<ol class="commentlist">
<?php
    //Gather comments for a specific page/post 
    $comments = get_comments(array(
        'post_id' => XXX,
        'status' => 'approve' //Change this to the type of comments to be displayed
    ));

    //Display the list of comments
    wp_list_comments(array(
        'per_page' => 10, //Allow comment pagination
        'reverse_top_level' => false //Show the latest comments at the top of the list
    ), $comments);
?>

    
asked by anonymous 04.09.2015 / 05:02

0 answers