WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#30157 closed enhancement (fixed)

Remove allowed tags from comment_notes_after parameter of comment_form()

Reported by: krogsgard Owned by: rachelbaker
Milestone: 4.3 Priority: normal
Severity: normal Version:
Component: Comments Keywords: has-patch commit
Focuses: ui, accessibility Cc:

Description

A while back I wrote a post detailing (amongst other things to do with comments in WordPress) that the allowed tags displayed below comments has a lot of potential to be distracting. I propose we get rid of that output in the comment form. It's very confusing to users and I don't think very relevant. Nacin agreed in the comments, and I'd like to move the discussion forward.

Allowed tags are output as the comment_notes_afterparameter of comment_form. The patch below simply removes it. A plugin or theme developer could easily re-enable this, but I don't think they will.

Attachments (2)

30157.diff (1.2 KB) - added by krogsgard 5 years ago.
Remove default comment_notes_after
30157.patch (2.8 KB) - added by rachelbaker 4 years ago.

Download all attachments as: .zip

Change History (22)

@krogsgard
5 years ago

Remove default comment_notes_after

This ticket was mentioned in Slack in #core by wonderboymusic. View the logs.


5 years ago

#2 @krogsgard
5 years ago

  • Keywords has-patch added

#3 @kpdesign
5 years ago

I agree with removing the allowed tags content in comment_notes_after.

I currently use that to display a short comment policy, and have seen it used that way on a lot of other sites.

+1 to 30157.diff

#4 follow-up: @afercia
4 years ago

If this goes in, please consider to remove also the the textarea aria-describedby attribute which points to comment_notes_after

Moreover, when themes/plugins override comment_notes_after to provide a different content, e.g. some comment policy or whatever as pointed out by @kpdesign, that content will not really ne be a description of the textarea.

Last edited 4 years ago by afercia (previous) (diff)

#5 @afercia
4 years ago

  • Focuses accessibility added

#6 in reply to: ↑ 4 @SergeyBiryukov
4 years ago

Replying to afercia:

Moreover, when themes/plugins override comment_notes_after to provide a different content, e.g. some comment policy or whatever as pointed out by @kpdesign, that content will not really ne be a description of the textarea.

Yes, but the aria-describedby attribute added in [29846] specifically references #form-allowed-tags.

Good catch on removing it if 30157.diff goes in.

#7 @SergeyBiryukov
4 years ago

#32500 was marked as a duplicate.

#9 @rachelbaker
4 years ago

  • Owner set to rachelbaker
  • Status changed from new to assigned

#10 @rachelbaker
4 years ago

  • Milestone changed from Awaiting Review to 4.3

#11 @obenland
4 years ago

@krogsgard, could you add a link to you post for posterity?

The patch needs to be refreshed too, to include removing the aria-describedby label. @rachelbaker, would you want to do that?

#12 @rachelbaker
4 years ago

@obenland Yes, I am updating the patch.

Here is the link @krogsgard was referencing: https://poststatus.com/wordpress-comments/

#13 @rachelbaker
4 years ago

  • Status changed from assigned to accepted

@rachelbaker
4 years ago

#14 @rachelbaker
4 years ago

Refreshed the original patch: removed the $comment_notes_after default param information, and removed the aria-describedby reference.

#15 @rachelbaker
4 years ago

@obenland what do you think?

#16 @obenland
4 years ago

I'm just a little hesitant because it would remove it for all existing sites too and I'm not sure how excited people are if we mess with their front end on an update.

An option could be to limit it to modern themes by checking theme support for html5 comments.

Or I'm overthinking this.

#17 @knutsp
4 years ago

I think this should not be removed. Let themes easily remove this by a filter. Maybe remove this by default only on new installs, at let it then be enabled by a filter.

#18 @johnbillion
4 years ago

  • Keywords commit added
  • Version 4.0 deleted

It's 2015. Nobody wants to see a list of HTML tags and attributes that they can use in comments. Those who would use HTML in a comment will already know which tags are likely to be accepted, and those who don't know HTML don't need to see this list. Those who really need it can use the comment_form_default_fields filter to re-implement it.

Do it.

#19 @krogsgard
4 years ago

+1 to @johnbillion. Also, to note something in my original post about this... no third party commenting systems show anything like this. Showing the tags is confusing to users and easy to put back for power users with a very simple plugin for folks that want to hold on to it.

#20 @obenland
4 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 32858:

Remove allowed tags from comment form.

It can be confusing to users and for most it is not relevant.
Commenters comfortable with HTML will know which tags are likely
to be accepted.

Props krogsgard, rachelbaker.
Fixes #30157.

Note: See TracTickets for help on using tickets.