Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#49384 closed defect (bug) (fixed)

incorrect description for $editor_id param to wp_editor()

Reported by: pbiron's profile pbiron Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.4 Priority: normal
Severity: normal Version:
Component: TinyMCE Keywords: 2nd-opinion
Focuses: docs Cc:


The description for $editor_id says:

HTML ID attribute value for the textarea and TinyMCE. Can only be /[a-z]+/.

While $editor_id can't contain a [ character (introduced in [27950], which does a _deprecated_argument() call), as far as I can tell, there are no other restrictions on $editor_id as long as it is a legal value for an HTML @id.

Additionally, wp_editor() passes $editor_id on to _WP_Editors::editor(), and the description for $editor_id param for that method specifies a different restriction on the legal values for it:

ID for the textarea and TinyMCE and Quicktags instances (can contain only ASCII letters and numbers).

Change History (4)

#1 @SergeyBiryukov
4 years ago

Related: [18498], [19239], [32899].

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

#2 @SergeyBiryukov
4 years ago

It's worth noting that [32899] introduced $editor_id_attr = esc_attr( $editor_id ), so the restrictions seem less relevant now, apart from the [] brackets limitation.

#3 @SergeyBiryukov
4 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 47210:

Docs: Improve description for the $editor_id parameter of wp_editor() and _WP_Editors::editor().

The restictions mentioned for the parameter value should be consistenct.

Props pbiron, SergeyBiryukov.
Fixes #49384.

#4 @SergeyBiryukov
4 years ago

  • Milestone changed from Awaiting Review to 5.4
Note: See TracTickets for help on using tickets.