Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#16503 closed defect (bug) (fixed)

get_post_format() generates queries on unsupported post types

Reported by: nacin's profile nacin Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version:
Component: Performance Keywords: has-patch commit
Focuses: Cc:

Description

get_post_format() is used in two places in the list table templating, which will cause an unnecessary term fetch query for every post. That's no fun.

I started to fix this by patching the problem instances. But it should itself bail early if the post type isn't supported. Incoming patch does both. Pick and choose.

Attachments (2)

16503.diff (1.8 KB) - added by nacin 13 years ago.
16503.2.diff (441 bytes) - added by nacin 13 years ago.

Download all attachments as: .zip

Change History (6)

@nacin
13 years ago

@nacin
13 years ago

#1 @nacin
13 years ago

Going with the get_post_format early return per IRC.

#2 @nacin
13 years ago

  • Keywords commit added

#3 @ryan
13 years ago

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

(In [17429]) Don't query the post format for post types that don't support formats. Props nacin. fixes #16503 for trunk

#4 @ryan
13 years ago

(In [17430]) Don't query the post format for post types that don't support formats. Props nacin. fixes #16503 for 3.1

Note: See TracTickets for help on using tickets.