Opened 17 years ago
Closed 17 years ago
#11439 closed defect (bug) (fixed)
get_body_class() does unnecessary work
| Reported by: | filosofo | Owned by: | ryan |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.0 |
| Component: | Template | Version: | 2.9 |
| Severity: | normal | Keywords: | has-patch tested |
| Cc: | Focuses: |
Description
get_blog_class() calls setup_postdata() unnecessarily, when there's an API in WP_Query for exactly this purpose.
Patch fixes.
Attachments (3)
Change History (13)
#3
@
17 years ago
- Keywords tested removed
My patch is wrong, global $wpdb is still needed and should not be removed.
#5
@
17 years ago
- Keywords needs-patch added; has-patch removed
I also get a fatal error when I apply it.
#6
@
17 years ago
I incorporated Denis's suggestion for handling private pages, fixed the fatal error, but left out the unrelated stuff that Denis has in 11439.diff.
unnecessary_global_tampering.11439.diff should be the best patch now. Agreed?
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Tested against current head. Works. Then I reviewed the code and
AND post_status != 'private'looks to me like this fixes some other bug. I have created an additional patch w/o that segment. If applied, a new ticket might be created based on the finding by filosofo.