[wp-trac] [WordPress Trac] #18551: get_userdata returning full user object, not data like it used to

WordPress Trac wp-trac at lists.automattic.com
Fri Jan 6 21:29:35 UTC 2012


#18551: get_userdata returning full user object, not data  like it used to
--------------------------+--------------------------
 Reporter:  anmari        |       Owner:  markjaquith
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Users         |     Version:  3.3
 Severity:  major         |  Resolution:  invalid
 Keywords:                |
--------------------------+--------------------------

Comment (by beezeee):

 FWIW foreach ((array) $user as $key => $value) is a bad practice ASSUMING
 you only want the meta data. Assuming is bad practice too, especially when
 making assumptions about the way developers are using one of the most
 widely adopted platforms in this sphere.

 I personally was doing exactly this to aggregate user data agnostically,
 so that we can render disparate elements for a collection of users with
 the minimum queries required. Fortunately this only took a wrapper
 function and a few lines of code to detect version and format an array
 accordingly if needed.

 Going forward, I think it is crucial for WP development to maintain
 backwards compatibility.

 While I agree that lazy loading meta is generally a great practice, it
 makes '''far more sense''' to introduce a new function that provides this
 lighter response, rather than overwriting existing ones potentially
 breaking code built to work on top of those existing functions.

 Let's please consider the developers using the platform before pulling the
 rug out from under with a hasty modification like this, no matter how
 justifiable the intentions are.

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


More information about the wp-trac mailing list