Make WordPress Core

Opened 5 months ago

Closed 2 months ago

#60581 closed enhancement (fixed)

Redundant variable type check

Reported by: davidbinda's profile david.binda Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.6 Priority: normal
Severity: minor Version: 6.5
Component: Shortcodes Keywords: has-patch
Focuses: Cc:

Description

After the r57597, which is ensuring that the return type of the shortcode_parse_atts function is always an array, the is_array check in get_post_galleries function is, IMHO, no longer needed.

Attachments (1)

60581.diff (552 bytes) - added by david.binda 5 months ago.

Download all attachments as: .zip

Change History (5)

@david.binda
5 months ago

#1 @swissspidy
5 months ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 6.6
  • Severity changed from normal to minor

Makes sense, good catch.

#2 @oglekler
2 months ago

@SergeyBiryukov this is simple enough, and it looks like cannot return anything apart from array for now, so we can make this change.

#3 @SergeyBiryukov
2 months ago

  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#4 @SergeyBiryukov
2 months ago

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

In 58168:

Shortcodes: Remove redundant variable type check in get_post_galleries().

shortcode_parse_atts() always returns an array as of [57597], so the check is no longer needed.

Follow-up to [40070], [57597].

Props david.binda, swissspidy, oglekler.
Fixes #60581.

Note: See TracTickets for help on using tickets.