Title: Recent Comments
Author: Automattic
Published: <strong>2005 年 1 月 13 日</strong>
Last modified: 2021 年 2 月 10 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/recent-comments.svg)

# Recent Comments

 作者：[Automattic](https://profiles.wordpress.org/automattic/)

[下载](https://downloads.wordpress.org/plugin/recent-comments.zip)

 * [详情](https://cn.wordpress.org/plugins/recent-comments/#description)
 * [评价](https://cn.wordpress.org/plugins/recent-comments/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/recent-comments/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/recent-comments/#developers)

 [支持](https://wordpress.org/support/plugin/recent-comments/)

## 描述

Creates functions to assist in displaying a list of the most recent comments. Provides
more configurability than the widget that comes with WordPress.

### Configuration

You may pass parameters when calling the function to configure some of the options.
Parameters are accepted only in the [query-string-style](https://codex.wordpress.org/How_to_Pass_Tag_Parameters#Tags_with_query-string-style_parameters).

#### list_most_recent_comments()

In addition to the parameters that [get_comments()](https://codex.wordpress.org/Function_Reference/get_comments)
and `get_most_recent_comments()` (see below) accept, this function accepts the following
parameters:

 * `excerpt_words` — The number of words from the comment to display
 * `excerpt_chars` — Or alternately the number of characters from the comment to
   display
 * `comment_format` — Allows you to pick from two predefined display formats:

 1. [Comment Author](https://cn.wordpress.org/plugins/recent-comments/?output_format=md#commentlink)
    on [Post Title](https://cn.wordpress.org/plugins/recent-comments/?output_format=md#postlink)
 2. **Comment Author:** [This is the comment excerpt](https://cn.wordpress.org/plugins/recent-comments/?output_format=md#commentlink)

Example:

    ```
    <?php list_most_recent_comments( 'excerpt_words=5' ); ?>
    ```

#### get_most_recent_comments()

A more powerful version of [get_comments()](https://codex.wordpress.org/Function_Reference/get_comments).
It accepts the same parameters as well as the following ones:

 * `passworded_posts` — Boolean to control showing comments on passworded posts 
   or not. Defaults to `false`.
 * `showpings` — Boolean to control showing pings and trackbacks or not. Defaults
   to `false`.
 * `post_types` — Array of post types to include comments from. Defaults to posts
   and pages: `array( 'post', 'page' )`
 * `post_statuses` — Array of post statuses to include comments from. Defaults to
   published posts and static pages: `array( 'publish', 'static' )`

Arguments should likely be passed as an array instead of a string.

Example:

    ```
    <?php

    list_most_recent_comments( array(
        'showpings' => true,
        'post_types' => array( 'post', 'page', 'foobar' ),
    ) );

    ?>
    ```

## 安装

 1. Visit Plugins -> Add New in your WordPress administration area and search for the
    name of this plugin.
 2. Activate the plugin.
 3. Add `<?php list_most_recent_comments(); ?>` to your theme.

## 评价

此插件暂无评价。

## 贡献者及开发者

「Recent Comments」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Automattic ](https://profiles.wordpress.org/automattic/)
 *   [ Nick Momrik ](https://profiles.wordpress.org/nickmomrik/)
 *   [ Alex Mills ](https://profiles.wordpress.org/viper007bond/)

[帮助将「Recent Comments」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/recent-comments)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/recent-comments/)，查看
[SVN仓库](https://plugins.svn.wordpress.org/recent-comments/)，或通过[RSS](https://plugins.trac.wordpress.org/log/recent-comments/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/recent-comments/)。

## 更新日志

#### Version 2.0.0

 * Recoded from scratch to make use of `get_comments()` instead of a direct database
   query.
 * Additional parameters added.

#### Version 1.0.0

 * Original release

## 额外信息

 *  版本 **2.1**
 *  最后更新：**5 年前**
 *  活跃安装数量 **200+**
 *  语言
 * [English (US)](https://wordpress.org/plugins/recent-comments/)
 * 标签
 * [comments](https://cn.wordpress.org/plugins/tags/comments/)[list](https://cn.wordpress.org/plugins/tags/list/)
   [recent](https://cn.wordpress.org/plugins/tags/recent/)
 *  [高级视图](https://cn.wordpress.org/plugins/recent-comments/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/recent-comments/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/recent-comments/reviews/)

## 贡献者

 *   [ Automattic ](https://profiles.wordpress.org/automattic/)
 *   [ Nick Momrik ](https://profiles.wordpress.org/nickmomrik/)
 *   [ Alex Mills ](https://profiles.wordpress.org/viper007bond/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/recent-comments/)