Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#60581 closed enhancement (fixed)

Redundant variable type check

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

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 2 years ago.

Download all attachments as: .zip

Change History (5)

@david.binda
2 years ago

#1 @swissspidy
2 years ago

  • Keywords has-patch added
  • Milestone Awaiting Review6.6
  • Severity normalminor

Makes sense, good catch.

#2 @oglekler
2 years 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 years ago

  • Owner set to SergeyBiryukov
  • Status newreviewing

#4 @SergeyBiryukov
2 years ago

  • Resolutionfixed
  • Status reviewingclosed

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.