Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- global $user;
- $args = array(
- 'user_id' => $user->ID,
- 'number' => 10, // how many comments to retrieve
- 'status' => 'approve'
- );
- $comments = get_comments( $args );
- if ( $comments )
- {
- $output.= "<ul>\n";
- foreach ( $comments as $c )
- {
- $output.= '<li>';
- $output.= '<a href="'.get_comment_link( $c->comment_ID ).'">';
- $output.= get_the_title($c->comment_post_ID);
- $output.= '</a>, Posted on: '. mysql2date('m/d/Y', $c->comment_date, $translate);
- $output.= "</li>\n";
- }
- $output.= '</ul>';
- echo $output;
- } else { echo "No comments made";}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement