WordPress.org

Make WordPress Core

#24003 closed defect (bug) (fixed)

Post Formats: get_the_post_format_media does not work without the $post global

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

Description

The get_the_post_format_media takes a $post argument, but doesn't pass it on to some of its functions (has_post_format and get_attached_*), making those functions work with the $post global instead.

Attachments (2)

24003.diff (711 bytes) - added by kovshenin 13 months ago.
24003.2.diff (427 bytes) - added by kovshenin 13 months ago.

Download all attachments as: .zip

Change History (5)

kovshenin13 months ago

comment:1 SergeyBiryukov13 months ago

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

In 23937:

Consistently use the function argument instead of the $post global in get_the_post_format_media(). props kovshenin. fixes #24003.

kovshenin13 months ago

comment:2 kovshenin13 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

24003.2.diff is a similar fix for get_the_post_format_image and get_attached_images. Sorry for not catching these together. Thought I'd squeeze it in here, but let me know if you want a separate ticket for this.

comment:3 SergeyBiryukov13 months ago

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

In 23938:

Use the function argument instead of the $post global in get_the_post_format_image(). props kovshenin. fixes #24003.

Note: See TracTickets for help on using tickets.