Forums

How to make a friendlier comment error message? (7 posts)

  1. alanholding
    Member
    Posted 4 years ago #

    I have a site that uses WP 2.5.1.

    If someone submits an 'empty' comment (i.e. they just press the submit button), they are shown a blank page with the message 'Error: please type a comment.'

    I think this is a bit poor from a usability point of view, as people are taken out of the post they were commenting about and simply dumped into wp-comments-post.php which shows the error message. (I assume this is something to do with the wp_die function called in wp-comments-post.php when an empty comment is submitted.)

    Is there any way of having the error handled better - such as keeping the user on the post they were commenting on and simply showing the error message above the comment form?

    Thanks.

  2. bodum
    Member
    Posted 3 years ago #

    I have the same usability problem. The Error-Dialog is not the best way to handle the error. Could someone please try to fix this?

    The only way for me atm is to check the Form with javascript.

    Thanks.

  3. t31os
    Member
    Posted 3 years ago #

    Having a little look around it doesn't look like theres any easy way that doesn't involve editing wp-comments.post.php, which is of course a core file...

    Let you know if i find something though as i'd like a way to change this without having to make changes for each WP version.

  4. bodum
    Member
    Posted 3 years ago #

    Yes, I know that I can fix this by modifing the wp-comments, and I know how to do this. But this should be changed from the wp-core-team. If I change it locally, I have to do it every time wp gets updated.

  5. t31os
    Member
    Posted 3 years ago #

    Yes that's my point, i'd rather not be having to do that either....

    If you want it added into WP you should perhaps post a feature request...

    Though personally i'd like to see all WP messages handled by a language file, and then the ability for themes to hook into their own language file if one exists... that way all messages can be customised at a theme level...

    I'm not really too fussed, i'm sure i can bodge something to work around it if i really really want to change the message.

  6. bodum
    Member
    Posted 3 years ago #

  7. t31os
    Member
    Posted 3 years ago #

    Nice, i think it's a good idea, perhaps a * or box highlighted to show which fields were missed...

Topic Closed

This topic has been closed to new replies.

About this Topic