[wp-trac] [WordPress Trac] #20529: r20565 introduces get_the_author_meta() regression

WordPress Trac wp-trac at lists.automattic.com
Tue Apr 24 14:38:23 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             |  Resolution:
 Keywords:  reporter-feedback  |
-------------------------------+------------------

Comment (by nacin):

 After talking with johnjamesjacoby, the issue is that before r20565, every
 call to a property of $authordata was first surrounded by an isset()
 check. Thus, if you called get_the_author_meta() without a $user_id when
 no postdata was set up, you would just get an empty string. (Or int(0) if
 you requested 'id' as a $field.) But, under r20565, you get a notice for
 $authordata->ID in addition to the empty string (no int(0) anymore).

 Having get_the_author_meta() automatically check $post and reset postdata
 is interesting, but it would imply that $post was manually manipulated and
 that setup_postdata() was not called. If we are to be clever, it shouldn't
 be for edge cases. We *could* actually call the_post(), rewind_posts(),
 and wp_reset_postdata() like we do in an author.php typically. (I have a
 feeling that could break quite a bit though.) Regardless, it is an
 enhancement that deserves its own ticket.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20529#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list