更新时间:2023-11-30 17:50:10
查询注释是正常的wordpress方法,但是您需要将其包括在上面链接和指向的条件中。
The query for the comments is the normal wordpress way, but you need to include it in the conditionals linked and pointed above.
用法示例:
<?php
if ( is_user_logged_in() ) {
$user_id = get_current_user_id();
$args = array(
'status' => 'approve',
'order' => 'DESC',
'user_id' => $user_id
);
$comments = get_comments($args);
foreach($comments as $comment) :
echo '<p>';
echo($comment->comment_author . '<br />' . $comment->comment_content);
echo '</p>';
endforeach;
}
?>