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

Comment Form Inline Errors

描述

This plugin takes care of WordPress inner comments error handling, and shows comment errors above the form, instead of using the weird grey page with single line error description. All this out-of-the-box.

It also remembers what you’ve typed in. So for example, if you fill in the comment form, and send it and forget required field, it will show the error above the form, and prefills the form with values you’ve submitted so you don’t have to retype them again (which is annoying).

By default, the plugin prints the error in this markup:

<div id="formError" class="formError" style="color:red;">
    <p>--error-here--</p>
</div><div class="clear clearfix"></div>

So it should be quite easy for you to style it in your css file with ".formError" or "#formError", you know the drill :). The default red colour is there just in case you won’t be able to style and since it’s error, red seems appropriate.

By the way, if you’ve customised your comment form with new fields, and you’re using the preprocess_comment hook, with the correct WordPress way of handeling errors, which is using wp_die on error encounter, this plugin will play nicely with that, and display your error messsage above the form as well.

螢幕截圖

  • This shows form error before plugin activation, and after.
  • With plugin activated, before submitting our comment.
  • With plugin activated, after comment submission.

安裝

  1. Go to your admin area and select Plugins -> Add new from the menu.
  2. Search for “Comment Form Inline Errors”.
  3. Click install.
  4. Click activate.

常見問題

It doesn’t do anything, what should I do?

If that is the case, deactivate the plugin, delete it, and move on :).

I have a costum post type with comments support, will this work with it?

Yes, it will.

I have my own custom comment form fields, will it remember the values of those after error as well?

Do you know what? It actually might, if they are hooked in comment_form_default_fields, but it only checks for inputs[text] and textareas tho :).

評價

There are no reviews for this plugin.

貢獻者及開發者

“Comment Form Inline Errors” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

將 Comment Form Inline Errors 外掛本地化為台灣繁體中文版。

對開發相關資訊感興趣?

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

修改日誌

1.0.2

  • Tested on new WP version.

1.0.1.1

  • Fixed spelling.

1.0.1

  • Fixed backslash issue.

1.0

  • Plugin released.