#15322 closed defect (bug) (fixed)
Skip category and tag queries on non posts in get_post_class()
Reported by: | mfields | Owned by: | |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | Template | Keywords: | dev-feedback has-patch |
Focuses: | Cc: |
Description
Where post_class() is used in a loop that iterates over an array of non-post objects get_post_class() will query for categories and tags regardless. Most times, these taxonomies are not registered with the post_type. This bug results in 2 additional queries per iteration. Please see attached (post-class-test.php) for an example using attachments.
Attachments (2)
Change History (10)
#1
@
14 years ago
- Milestone changed from Awaiting Review to 3.1
Thanks for the fix. For future reference:
http://codex.wordpress.org/Reporting_Bugs#Patch_Writing_Guidelines
#3
@
14 years ago
Scribu. No problem! Been trying to find ways to help out in here. What could I have been done better with the patch?
#4
@
14 years ago
Well, the patch was made relative to the wp-includes folder, when it should have been made relative to the wp folder.
Less importantly, if(
should have been if (
as per the coding standards.
#5
@
14 years ago
I thought that might be the issue. I used Tortoise SVN to create the patch and there was not an option for anything like this. I have yet to use svn via the command line, but I can definitely learn.
Could you please explain how to do this?
I'll reread the coding standards.
I missed that bit before.
#6
@
14 years ago
Unfortunately, there's no command line version of svn for Windows.
And I'm on Ubuntu, so I don't know how you should do it via TortoiseSVN.
How to reproduce