[wp-trac] [WordPress Trac] #36508: Call cache_users() when 'fields'=>'all' in WP_User_Query

WordPress Trac noreply at wordpress.org
Wed Apr 13 15:04:50 UTC 2016


#36508: Call cache_users() when 'fields'=>'all' in WP_User_Query
-----------------------------+-----------------------------
 Reporter:  danielbachhuber  |       Owner:
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Future Release
Component:  Users            |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  needs-patch      |     Focuses:  performance
-----------------------------+-----------------------------

Comment (by danielbachhuber):

 I think this option would be the most precise:

 > We introduce a standalone function for priming the wp_x_capabilities
 cache, and call that - either instead of cache_users() or as an option
 within cache_users() - when fields=all.

 Solely priming the capabilities cache would continue to respect the
 distinction between `fields=>all` and `fields=>all_with_meta`, while also
 addressing the unnecessary queries issue.

 I agree with this sentiment too:

 > But usermeta also tends to be abused, so that fetching usermeta for all
 users in a query can significantly affect memory footprint.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36508#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list