Make WordPress Core

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#16503 closed defect (bug) (fixed)

get_post_format() generates queries on unsupported post types

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

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 16 years ago.
16503.2.diff (441 bytes ) - added by nacin 16 years ago.

Download all attachments as: .zip

Change History (6)

@nacin
16 years ago

@nacin
16 years ago

#1 @nacin
16 years ago

Going with the get_post_format early return per IRC.

#2 @nacin
16 years ago

  • Keywords commit added

#3 @ryan
16 years ago

  • Resolutionfixed
  • Status newclosed

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

#4 @ryan
16 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.