Make WordPress Core

Opened 9 months ago

Closed 4 months ago

#64576 closed enhancement (fixed)

Add support for invoker command attributes

Reported by: joedolson Owned by: joedolson
Priority: normal Milestone: 7.1
Component: Formatting Version:
Severity: normal Keywords: has-patch has-unit-tests commit
Cc: Focuses: ui, accessibility, javascript, css

Description

Similar to the support added to popovers, invoker commands are now baseline, and should be allowed in post content.

See #61959.

Change History (11)

#2 @westonruter
9 months ago

Related:

This ticket was mentioned in ​Slack in #accessibility by joedolson. ​View the logs.


7 months ago

#4 @joedolson
7 months ago

  • Milestone Awaiting Review → 7.1

This ticket was mentioned in ​PR #11483 on ​WordPress/wordpress-develop by ​@pratiknawkar94.


6 months ago
#5

  • Keywords has-patch has-unit-tests added; needs-patch removed

Allow the Invoker Commands API attributes command and commandfor on <button> in $allowedposttags so post content sanitization (wp_kses_post()) no longer strips them. This matches existing support for popovertarget / popovertargetaction from the Popover API work (#61959).

Adds a PHPUnit test that verifies a button with command / commandfor and a popover target survives wp_kses_post().

#6 follow-up: @afercia
4 months ago

​https://github.com/WordPress/wordpress-develop/pull/11483 looks good to me.

Question: should we allow the autofocus global attribute?
It's pretty important to handle focus within a <dialog> element.

#7 in reply to: ↑ 6 ; follow-up: @westonruter
4 months ago

Replying to afercia:

Question: should we allow the autofocus global attribute?
It's pretty important to handle focus within a <dialog> element.

My only concern is abuse, where someone could write a post and add autofocus to it as a way to get more eyes on it. So maybe we should open a separate ticket for that, and maybe strip it out automatically if it isn't inside a DIALOG.

#8 in reply to: ↑ 7 @afercia
4 months ago

  • Keywords commit added

Replying to westonruter:

My only concern is abuse, where someone could write a post and add autofocus to it as a way to get more eyes on it. So maybe we should open a separate ticket for that, and maybe strip it out automatically if it isn't inside a DIALOG.

Good point. Agree on creating a new ticket for the autofocus attribute.

#9 @afercia
4 months ago

  • Component General → Formatting

#10 @afercia
4 months ago

I created #65491 for the autofocus attribute. I think this is unblocked now and can be committed.

#11 @afercia
4 months ago

  • Resolution → fixed
  • Status assigned → closed

In 62531:

KSES: Add command and commandfor to the list of allowed attributes for buttons.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/11483

Props pratiknawkar94, joedolson, westonruter, afercia.

Fixes #64576.

Note: See TracTickets for help on using tickets.