Make WordPress Core

#64127 closed defect (bug) (fixed)

KSES: Add `name` attribute to the <details> element

Reported by: Soean Owned by: westonruter
Priority: normal Milestone: 6.9
Component: General Version: 6.8
Severity: normal Keywords: has-patch
Cc: Focuses:

Description (last modified by westonruter)

We should add the name attribute to the details element in the global $allowedposttags array.

The details block supports the name attribute since WP 6.8, so it needs to be added. Otherwise, it will be stripped when saving.

Related to:

Change History (7)

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


12 months ago
#1

  • Keywords has-patch added

We should add the name attribute to the details element in the global $allowedposttags array.

The details block supports the name attribute since WP 6.8, so it needs to be added. Otherwise, it will be stripped when saving.

Trac ticket: https://core.trac.wordpress.org/ticket/64127

#2 @westonruter
12 months ago

  • Milestone Awaiting Review → 6.9
  • Owner set to westonruter
  • Status new → accepted

#3 @westonruter
12 months ago

  • Keywords good-first-bug added
  • Owner westonruter removed
  • Status accepted → assigned

This is a good ticket for a new contributor to write up a patch. I'm happy to help commit!

#4 @westonruter
12 months ago

  • Keywords good-first-bug removed
  • Owner set to westonruter
  • Status assigned → reviewing

Oops. It has a patch 😊

#5 @westonruter
12 months ago

  • Description modified (diff)

#6 @westonruter
12 months ago

  • Version → 6.8

This issue was introduced in 6.8 via [59775] and Gutenberg 20.2.

#7 @westonruter
12 months ago

  • Resolution → fixed
  • Status reviewing → closed

In 61051:

Editor: Allow name attribute on the details element in KSES.

The details element supports the exclusive accordion behavior among multiple details elements by setting a common name attribute. The ability to set the name attribute in the Details block was added in of Gutenberg 20.2. However, when a user without unfiltered_html attempts to save the post, the name attribute gets erroneously stripped out. This prevents that.

See ​Details block: Exclusive accordions.

Follow-up to [14406], [59775].

Props soean.
See #12835, #62887.
Fixes #64127.

Note: See TracTickets for help on using tickets.