跳到内容

Comment Form Inline Errors

v1.0.2

latorante · 2013年9月11日 上架

Display comment form errors nicely!

正在使用
20+
评分
5.0 / 5
累计下载
3,221
最近更新
2013年11月15日
2 条评价需要 WordPress 3.0+已测试到 3.7.41

贡献者

截图

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

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.

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums