$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>listshow comments of post author in special page|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

listshow comments of post author in special page

matteradmin9PV0评论

i have a problem and i need you to save me really. i have many post authors with a lot of comments that every day is submitting. so i want to show comments that has submitted in every post to its post author in their user area to control them easily but i do not know to access WordPress admin area. so first, i want to know the posts that the current user ID has published and then, list the comments of those posts. of course except for those comments which the post author submitted as reply to others. please help me

i have a problem and i need you to save me really. i have many post authors with a lot of comments that every day is submitting. so i want to show comments that has submitted in every post to its post author in their user area to control them easily but i do not know to access WordPress admin area. so first, i want to know the posts that the current user ID has published and then, list the comments of those posts. of course except for those comments which the post author submitted as reply to others. please help me

Share Improve this question asked Nov 25, 2018 at 15:38 sh.dehnavish.dehnavi 411 silver badge12 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I found out it my self:

<?php
$post_ids = get_posts(array(
    'fields'        => 'ids', // Only get post IDs
    'posts_per_page'  => -1,
    'author'       => get_current_user_id(),
    'post_type' => 'post',
    'category' => 0, 
    'orderby' => 'date',
    'order' => 'DESC',
));
foreach($post_ids as $post_id) :

    $argss = array(
        'post_id' => $post_id,
        'status' => 'approve',
        'author__not_in' => get_current_user_id(),
    );
    $comments = get_comments($argss);
    foreach($comments as $comment) :
                echo "<div class=comment_listt>";
                echo '<i style="padding-left: 6px; font-size: 13px;">'. $comment->comment_author .'</i>';
                $greg_date = $comment->comment_date ; echo '(<i style="font-size: 13px;">'.jdate('d-m-Y H:i:s',strtotime($greg_date)).'</i>)';
                echo '<p style="padding:10px 0 0 0;">'. $comment->comment_content .'</p>';
                echo "<a href='". get_comment_link($comment->comment_ID)."'>go to reply</a></div>";
    endforeach;

endforeach;
?>

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far