[wp-trac] [WordPress Trac] #58327: Remove unneeded sanitize term in `populate_terms` method

WordPress Trac noreply at wordpress.org
Tue May 16 15:06:24 UTC 2023


#58327: Remove unneeded sanitize term in `populate_terms` method
--------------------------+----------------------------
 Reporter:  spacedmonkey  |      Owner:  (none)
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  Future Release
Component:  Taxonomy      |    Version:  6.0
 Severity:  normal        |   Keywords:
  Focuses:  performance   |
--------------------------+----------------------------
 In [52836] ( #37189 ) the WP_Term_Query class was converted to just get
 ids and then convert those ids into WP_Term objects using get_term. But in
 the case where fields `all_with_object_id` is passed, this results in lots
 of calls to sanitize_term. These calls can be extensive and effect
 performance. `all_with_object_id` expects an object as a result, but does
 not necessarily need to be  sanitized.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58327>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list