• Hello there,
    I’m currently working on a widget that shows recent comments in the sidebar. I used WP_Comment_Query for querying the recent comments. But the returned array is and empty array. Here is the code that I wrote:

    $query_args = array(
    	'number' => 5,
    	'order' => 'DESC'
    );
    
    $recent_comments = new WP_Comment_Query($query_args);

    And when I checked the returned array with print_r(); I got the following code:

    WP_Comment_Query Object
    (
        [meta_query] =>
    )

    I know that I can get recent comments with the help of get_comments(); function but I wonder why the class is not working. 🙁
    Thanks in advance,
    waiting for your reply.

  • The topic ‘WP_Comment_Query not working’ is closed to new replies.