Comment Changes in WordPress 4.5

WordPress 4.5 includes several ancient bug fixes and a few enhancements in the Comments component. We have closed 25 tickets. Check out the full list of changes.

Moderate Comment Screen Refresh

This often neglected screen has received a UX update. Don’t know what the “Moderate Comment” screen is? This is where you land when clicking one of the moderation actions from a comment notification email message.

Changes of note:

  • Comment content is formatted for display, instead of one massive block of escaped text
  • Include navigation via a text link to the Edit Comment screen at the bottom of the comment
  • Updated message styles that match other screens
  • Only wrap the comment date in a link if the comment permalink exists to avoid confusion
  • Appended #wpbody-content to the comment email message links for accessibility

Before:
34133-before
After:
34133-after

See #34133

Max Lengths for Comment Form Fields

Be verbose without having to worry that your insightful words will be lost.

The comment form will now enforce the maximum length of each field’s respective database column with hardcoded maxlength attributes. The hardcoded maxlength attributes can be adjusted for custom database schemas by using the comment_form_default_fields filter.

The default length settings are as follows:

  • Comment: 65525 characters
  • Name : 245 characters
  • Email: 100 characters
  • Url: 200 characters

Comments will also have the input lengths checked by the new function wp_get_comment_fields_max_lengths(), and accompanying filter wp_get_comment_fields_max_lengths, upon submission returning a WP_Error object if any value is longer than its database column.

See #10377.

Comment Error Page Navigation

Previously, visitors who submitted a comment that was unable to be processed were shown an error message without a method to navigate back to their comment. Your potential commenter would have to use their browser’s back button to get back to their comment to resolve the error.

A simple back link has been added to the bottom of the error message page. See the screenshots below.

Before:
4332-before

After:
4332-after

See #4332.

Other Changes of Note

  • The rel=nofollow attribute and value pair will no longer be added to relative or same domain links within comment_content. See #11360.
  • WP_Comment_Query now supports the author_url parameter. See #36224.
  • The new pre_wp_update_comment_count_now filter allows you to bail out of updating the comment count for a given Post. See #35060

#4-5, #comments, #dev-notes