#21711 closed enhancement (wontfix)
Twenty Twelve: use get_queried_object instead of the_post/rewind_posts in author archives
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Bundled Theme | Keywords: | has-patch |
Focuses: | 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)
#2
@
13 years ago
- Keywords has-patch added
if ( isset( $author->description ) && ! empty( $author->description ) )
! empty()
would be enough.
#4
follow-up:
↓ 6
@
13 years 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.
#6
in reply to:
↑ 4
@
13 years ago
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