Make WordPress Core

Opened 18 months ago

Closed 18 months ago

Last modified 16 months ago

#57691 closed defect (bug) (fixed)

Short array syntax used in WP_HTML_Tag_Processor docs/examples

Reported by: aristath's profile aristath Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.2 Priority: normal
Severity: normal Version:
Component: HTML API Keywords: has-patch
Focuses: docs Cc:

Description

Docs for methods in the WP_HTML_Tag_Processor object use a short array syntax. However, that syntax is not allowed in WP.

Change History (6)

This ticket was mentioned in PR #4048 on WordPress/wordpress-develop by @aristath.


18 months ago
#1

  • Keywords has-patch added

#3 @aristath
18 months ago

Done in Gutenberg in https://github.com/WordPress/gutenberg/pull/47958. The PR attached above is a backport.

#4 @SergeyBiryukov
18 months ago

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

In 55304:

Docs: Replace short array syntax in WP_HTML_Tag_Processor documentation.

Per WordPress PHP Coding Standards:

Using long array syntax ( array( 1, 2, 3 ) ) for declaring arrays is generally more readable than short array syntax ( [ 1, 2, 3 ] ), particularly for those with vision difficulties. Additionally, it’s much more descriptive for beginners.

Arrays must be declared using long array syntax.

Original PR from Gutenberg repository:

Follow-up to [55203], [55206].

Props aristath, poena.
Fixes #57691.

@SergeyBiryukov commented on PR #4048:


18 months ago
#5

Thanks for the PR! Merged in r55304.

#6 @SergeyBiryukov
16 months ago

  • Component changed from General to HTML API
Note: See TracTickets for help on using tickets.