{"id":4196,"date":"2008-12-09T23:27:36","date_gmt":"2008-12-09T23:27:36","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/get-authors-comments\/"},"modified":"2009-08-02T14:49:18","modified_gmt":"2009-08-02T14:49:18","slug":"get-authors-comments","status":"publish","type":"plugin","link":"https:\/\/tg.wordpress.org\/plugins\/get-authors-comments\/","author":1397808,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.1.0","stable_tag":"1.1.0","tested":"2.9.2","requires":"2.7","requires_php":"","requires_plugins":"","header_name":"Get Author's Comments","header_author":"Mehdi Kabab","header_description":"","assets_banners_color":"","last_updated":"2009-08-02 14:49:18","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/pioupioum.fr\/wordpress\/plugins\/get-authors-comments.html","header_author_uri":"http:\/\/pioupioum.fr\/","rating":0,"author_block_rating":0,"active_installs":10,"downloads":3239,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0","1.0.1","1.1.0"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[132,131,107,944],"plugin_category":[44],"plugin_contributors":[79782],"plugin_business_model":[],"class_list":["post-4196","plugin","type-plugin","status-publish","hentry","plugin_tags-author","plugin_tags-comment","plugin_tags-comments","plugin_tags-search","plugin_category-discussion-and-community","plugin_contributors-pioupioum","plugin_committers-pioupioum"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/get-authors-comments.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>This plugin allows to display or retrieve comments posted by a user. In order to avoid homonyms, a user is identified by his name and email(s).<\/p>\n\n<p><strong>Note:<\/strong> Get Author's Comments uses the function <a href=\"http:\/\/codex.wordpress.org\/Template_Tags\/wp_list_comments\">wp&#095;list&#095;comments<\/a> introduced by WordPress 2.7 for the (x)HTML output.<\/p>\n\n<h3>Usage<\/h3>\n\n<h4>Display all comments of a specific user in the current post<\/h4>\n\n<pre><code>&lt;?php\n    &lt;ol&gt;\n        &lt;?php ppm_author_comments('piouPiouM', 'foo@example.com'); ?&gt;\n    &lt;\/ol&gt;\n?&gt;\n<\/code><\/pre>\n\n<p>or, if <em>piouPiouM<\/em> wrote with two different emails:<\/p>\n\n<pre><code>&lt;?php\n    &lt;ol&gt;\n        &lt;?php ppm_author_comments('piouPiouM', array('foo@example.com', 'bar@example.org')); ?&gt;\n    &lt;\/ol&gt;\n?&gt;\n<\/code><\/pre>\n\n<h4>Display all comments posted by a user<\/h4>\n\n<pre><code>&lt;?php\n    &lt;ol&gt;\n        &lt;?php ppm_author_comments('piouPiouM', 'foo@example.com', null, 'all=1'); ?&gt;\n    &lt;\/ol&gt;\n?&gt;\n<\/code><\/pre>\n\n<h4>Display comments wrote by a user in the post of ID number 9<\/h4>\n\n<pre><code>&lt;?php\n    &lt;ol&gt;\n        &lt;?php ppm_author_comments('piouPiouM', 'foo@example.com', 9); ?&gt;\n    &lt;\/ol&gt;\n?&gt;\n<\/code><\/pre>\n\n<p><strong>Note:<\/strong> If you used the tags <code>ppm_author_comments<\/code> or <code>ppm_get_author_comments<\/code> whithin <a href=\"http:\/\/codex.wordpress.org\/The_Loop\" title=\"The Loop &laquo; WordPress Codex\">The Loop<\/a>, the parameter <code>$postID<\/code> will be replaced automatically by the numeric ID of the current post.<\/p>\n\n<h4>Lastest comments ordered by post_ID<\/h4>\n\n<p>To show the last ten piouPiouM's comments sorted by post_ID in ascending order, the following will display their comment date and excerpt:<\/p>\n\n<pre><code>&lt;?php\n    $comments = ppm_get_author_comments('piouPiouM', 'foo@example.com', null, 'number=10&amp;order=ASC&amp;orderby=post_id');\n    foreach ($comments as $comment):\n?&gt;\n&lt;p&gt;&lt;cite&gt;&lt;?php comment_author_link() ?&gt;&lt;\/cite&gt; says:&lt;\/p&gt;\n&lt;ol&gt;\n    &lt;li&gt;\n        &lt;p&gt;Comment posted on &lt;?php comment_date('n-j-Y'); ?&gt;:&lt;br\/&gt;&lt;\/p&gt;\n        &lt;p&gt;&lt;?php comment_excerpt(); ?&gt;&lt;\/p&gt;\n    &lt;\/li&gt;\n&lt;\/ol&gt;\n&lt;?php endforeach; ?&gt;\n<\/code><\/pre>\n\n<h4>Comments with a custom comment display<\/h4>\n\n<pre><code>&lt;?php\n    &lt;ol&gt;\n        &lt;?php ppm_author_comments('piouPiouM', 'info@example.com', null, 'callback=mytheme_comment'); ?&gt;\n    &lt;\/ol&gt;\n?&gt;\n<\/code><\/pre>\n\n<p>See <a href=\"http:\/\/codex.wordpress.org\/Template_Tags\/wp_list_comments#Comments_Only_With_A_Custom_Comment_Display\" title=\"Template Tags\/wp list comments &laquo; WordPress Codex\">Comments Only With A Custom Comment Display<\/a> for an example of a custom callback function.<\/p>\n\n<h4>Show the total number of comments posted by a user on the site<\/h4>\n\n<pre><code>&lt;?php\n    get_currentuserinfo();\n    $comments = ppm_get_author_comments($current_user-&gt;display_name, $current_user-&gt;user_email, null, 'all=1');\n    printf('Hello ! &lt;a href=\"\/author\/%s\/\"&gt;%s&lt;\/a&gt;! '\n         . '[ &lt;a href=\"%s\" class=\"logout\"&gt;Log Out&lt;\/a&gt; ]&lt;br\/&gt;'\n         . '%d posts and %d comments',\n        $current_user-&gt;user_login,\n        $current_user-&gt;display_name,\n        wp_logout_url(),\n        get_usernumposts($current_user-&gt;ID),\n        count($comments));\n?&gt;&lt;h3&gt;Parameters&lt;\/h3&gt;\n<\/code><\/pre>\n\n<p><strong>all<\/strong><br \/>\n<em>(boolean)<\/em> <em>(optional)<\/em> Retrieve all comments. Default to <em>FALSE<\/em>.<\/p>\n\n<p><strong>number<\/strong><br \/>\n<em>(integer)<\/em> <em>(optional)<\/em> Number of comments to return. Default to <em>None<\/em>, returns all comments.<\/p>\n\n<p><strong>offset<\/strong><br \/>\n<em>(integer)<\/em> <em>(optional)<\/em> Offset from latest comment. Default to 0.<\/p>\n\n<p><strong>orderby<\/strong><br \/>\n<em>(string)<\/em> <em>(optional)<\/em> Sort posts by one of various values (separated by space), including:<\/p>\n\n<ul>\n<li><code>'comment_ID'<\/code> - Sort by numeric comment ID.<\/li>\n<li><code>'content'<\/code> - Sort by content.<\/li>\n<li><code>'date'<\/code> - Sort by creation date. (Default)<\/li>\n<li><code>'post_ID'<\/code> - Sort by post ID.<\/li>\n<li><code>'rand'<\/code> - Sort in random order.<\/li>\n<li><code>'status'<\/code> - Sort by status.<\/li>\n<li><code>'type'<\/code> - Sort by type.<\/li>\n<\/ul>\n\n<p><strong>order<\/strong><br \/>\n<em>(string)<\/em> <em>(optional)<\/em> Sort order, ascending or descending for the orderby parameter. Valid values:<\/p>\n\n<ul>\n<li><code>'ASC'<\/code> - Ascending (lowest to highest).<\/li>\n<li><code>'DESC'<\/code> - Descending (highest to lowest). (Default)<\/li>\n<\/ul>\n\n<p><strong>output<\/strong><br \/>\n<em>(string)<\/em> <em>(optional)<\/em> How you'd like the result. Only for <code>ppm_get_author_comments<\/code>.<\/p>\n\n<ul>\n<li><code>OBJECT<\/code> - Returns an object. (Default)<\/li>\n<li><code>ARRAY_A<\/code> - Returns an associative array of field names to values.<\/li>\n<li><code>ARRAY_N<\/code> - Returns a numeric array of field values.<\/li>\n<li><code>HTML<\/code> - Returns a (x)HTML version generated by <a href=\"http:\/\/codex.wordpress.org\/Template_Tags\/wp_list_comments\">wp&#095;list&#095;comments<\/a>.<\/li>\n<\/ul>\n\n<p><strong>status<\/strong><br \/>\n<em>(string)<\/em> <em>(optional)<\/em> The comments status. Default to hold and approve. Valid values:<\/p>\n\n<ul>\n<li><code>'hold'<\/code> - Unapproved.<\/li>\n<li><code>'approve'<\/code> - Approved.<\/li>\n<li><code>'spam'<\/code> - Spam.<\/li>\n<\/ul>\n\n<!--section=installation-->\n<p>Get Author's Comments is installed in 3 easy steps:<\/p>\n\n<ol>\n<li>Upload <code>get_authors_comments.php<\/code> to the <code>\/wp-content\/plugins\/<\/code> directory.<\/li>\n<li>Activate <code>Get Author's Comments<\/code> through the <em>Plugins<\/em> menu in WordPress.<\/li>\n<li><p>Add in your theme:<\/p>\n\n<pre><code>&lt;?php if (function_exist('ppm_author_comments')): ?&gt;\n    &lt;ol&gt;\n        &lt;?php ppm_author_comments('name', 'email', 'post_ID', 'args') ?&gt;\n    &lt;\/ol&gt;\n&lt;?php endif ?&gt;\n<\/code><\/pre><\/li>\n<\/ol>\n\n<!--section=changelog-->\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>Support a new <code>all<\/code> argument for retrieves all comments posted by a user.<\/li>\n<li>Add changelog and additional examples.<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>The arguments are case insensitive.<\/li>\n<li>Support of two new <code>orderby<\/code> arguments: <code>comment_ID<\/code> and <code>post_ID<\/code>.<\/li>\n<li>Set default <code>orderby<\/code> argument to <code>date<\/code>.<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial release.<\/li>\n<\/ul>","raw_excerpt":"Get Author&#039;s Comments displays or retrieves a list of comments posted by a user.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/4196","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/tg.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/tg.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=4196"}],"author":[{"embeddable":true,"href":"https:\/\/tg.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/pioupioum"}],"wp:attachment":[{"href":"https:\/\/tg.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=4196"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/tg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=4196"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/tg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=4196"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/tg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=4196"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/tg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=4196"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/tg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=4196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}