[wp-trac] [WordPress Trac] #20529: r20565 introduces get_the_author_meta() regression
WordPress Trac
wp-trac at lists.automattic.com
Tue Apr 24 00:11:25 UTC 2012
#20529: r20565 introduces get_the_author_meta() regression
-----------------------------+-----------------------
Reporter: johnjamesjacoby | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.4
Component: Users | Version:
Severity: normal | Keywords: has-patch
-----------------------------+-----------------------
Plugins like BuddyPress and bbPress use get_the_author_meta() on posts in
loops that may not set the $post global or might not even be a post at
all. Things like shortcodes and secondary loops of posts with their own
WP_Query object still need to use get_the_author_meta() and might not have
user ID information available in the $authordata global.
I suggest a few sanity checks to check for object/array values, and
load/reset them if they aren't around. Long term we should look into
smoother ways to get possibly cached post author data directly.
BackPress, bbPress 1.x, and !WordPress pre 2.8 had functions like
get_the_author_id() for convenience sake, but they were all deprecated in
!WordPress 2.8 in favor of the singular author_meta function.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20529>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list