這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

Comments Loop

外掛說明

The Comments Loop widget was written to allows users with no coding knowledge to customize their comments loop and comments form, all without editing their comments.php file.

Comments Loop is a complete widigitzation of the comments.php file, with over 30 settings to customize from reply links to what gets displayed when comments are closed. When you activate Comments Loop, you’ll have two new available widgets, Comments Loop and Comments Form. Simply drag and drop them in a sidebar that’s active in a singular template (e.g. single.php, page.php, or attachment.php).

View the FAQ section for more info on how to use Comments Loop.

螢幕擷圖

  • View of the Comments Loop widget settings.
  • View of the Comments Form widget settings.

安裝方式

  1. Upload ‘comments-loop’ to the ‘/wp-content/plugins/’ directory.
  2. Activate the plugin through the Plugins menu in WordPress.
  3. Go to Appearance > Widgets and place the Comments Loop or Comments Form widget where you want.

常見問題集

How does this widget work?

The Comments Loop and Comments Form widgets are basically an abstraction of the comments.php file. The Comments Loop widget makes use of the wp_list_comments() template tag to generate the custom loops. You can see a list of arguements at the wp_list_comments() codex page. Both widgets make strategic use of action hooks and filters for advance customization.

What are the available shortcodes in this widget?

The comments_meta in the Comments widget section may contain shortcodes.
In addition, the Comments Loop widget comes bundled with:

  • [author] – Displays the author of the post.
  • [date] – Displays the date the post was published.
  • [time] – Displays the time of day the post was posted.
  • [link] – Displays the comment’s permalink.
  • [reply] – Displays the reply link.
  • [edit] – Displays the edit link.

All shortcodes have before and after parameters. For instance, adding a seperator before the edit link would be: [edit before="| "]. In addition, the [edit] and [link] shortcodes have a label parameter to customize the actual text (e.g. [link label="Permalink"]). To customize the text for the [reply] shortcode, use reply_text and login_text.

What hooks are available in this widget?

The Comments Loop has several action hooks available throughout the loop process:

  • before_$comment_type_div – Before the opening of the #comments div
  • $comment_type_pagination – Right after the pagination links
  • before_$comment_type_list – Before the comments loop
  • before_$comment_type – Within the loop of $comment_type, right after the opening tag.
  • after_$comment_type – Within the loop of $comment_type, right after the closing tag.
  • after_$comment_type_list – After the comments loop
  • after_$comment_type_div – After the closing of the #comments div

NOTE Change $comment_type to be the value of the widget’s type parameter (e.g. comment, trackback, pingback, pings).

In addition, it also has several filter hooks where you can modify the function’s output:

  • cl_comment_meta – The text of the comment_meta widget settings
  • cl_comment_author – The post author
  • cl_comment_date – The date the comment was posted
  • cl_comment_time – The time of day the comment was posted
  • cl_comment_count – The comment count
  • cl_comment_link – The permalink for the comment
  • cl_comment_reply – The reply link
  • cl_comment_edit – The edit link to edit the comment.

The Comments Form has several action hooks available:

  • comment_form_before – Before the #respond div
  • comment_form_must_log_in_after – After the must_log_in text
  • comment_form_top – After the opening form tag
  • comment_form_logged_in_after – After the logged_in_as text
  • comment_form_before_fields – Before the input fields
  • comment_form_after_fields – After the input fields
  • comments_form – Before the closing form tag
  • comment_form_after – After the #respond div
  • comment_form_comments_closed – After the comments_closed text

使用者評論

這個外掛目前沒有任何使用者評論。

參與者及開發者

以下人員參與了開源軟體〈Comments Loop〉的開發相關工作。

參與者

將〈Comments Loop〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

0.1 (01/29/2010)

* Initial release.