#21711 closed enhancement (wontfix)
Twenty Twelve: use get_queried_object instead of the_post/rewind_posts in author archives
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Bundled Theme | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: |
Description
Hi there! I think it's easier and more correct to use a proper WP_User object in the author archives with get_queried_object, instead of "hacking" it with the_post and rewind_posts. The only drawback is that it's not being passed through the_author filter, but I think that's fine, because technically we're not in a loop anyway, and thus, should not use the_author_* functions either.
It's the same approach I'd use for tag and category archives, but luckily, single_term_title wraps the call to get_queried_object and does most of the work for us.
Attachments (2)
Change History (8)
If this works, Twenty Eleven and Twenty Ten can benefit from a similar change.
comment:2
SergeyBiryukov — 9 months ago
- Keywords has-patch added
if ( isset( $author->description ) && ! empty( $author->description ) )
! empty() would be enough.
comment:4
follow-up:
↓ 6
lancewillett — 9 months ago
- Resolution set to wontfix
- Status changed from new to closed
Discussed today in bug scrub, IRC #wordpress-dev.
See full log: https://irclogs.wordpress.org/chanlog.php?channel=wordpress-dev&day=2012-08-30&sort=asc#m448229
Template tags and rewind_posts() are working fine, here. Filters are good, too.
comment:5
SergeyBiryukov — 9 months ago
- Milestone 3.5 deleted
Replying to lancewillett:
Thanks so much for the feedback! I still feel like entering and rewinding the loop is not the most elegant approach, but yours, nacin's and obenland's arguments make sense. Thanks again :)

Uses get_queried_object instead of the_post/rewind_posts in author.php