WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#24393 closed defect (bug) (duplicate)

the_post_format_gallery() should not echo an empty array

Reported by: DrewAPicture Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.6
Component: Post Formats Keywords: has-patch
Focuses: Cc:

Description (last modified by DrewAPicture)

If a gallery format doesn't contain a gallery and you're using the_post_format_gallery(), an empty array might be echoed. Patch attached.

Attachments (1)

24393.patch (530 bytes) - added by DrewAPicture 2 years ago.

Download all attachments as: .zip

Change History (4)

@DrewAPicture2 years ago

comment:1 @DrewAPicture2 years ago

  • Description modified (diff)

comment:2 @SergeyBiryukov2 years ago

According to the inline docs, get_post_gallery() always returns an array:
trunk/wp-includes/media.php@24329#L2371.

Perhaps the_post_format_gallery() should take an empty array into account instead?

comment:3 @SergeyBiryukov2 years ago

  • Milestone 3.6 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #24390.

Note: See TracTickets for help on using tickets.