[wp-trac] [WordPress Trac] #54128: Consider caching the outputs for label arrays in get_post_type_labels and get_taxonomy_labels

WordPress Trac noreply at wordpress.org
Wed Sep 15 16:31:13 UTC 2021


#54128: Consider caching the outputs for label arrays in get_post_type_labels and
get_taxonomy_labels
-------------------------+-----------------------------
 Reporter:  kavelach     |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:
 Severity:  minor        |   Keywords:
  Focuses:  performance  |
-------------------------+-----------------------------
 Currently, each time something calls get_post_type_labels or
 get_taxonomy_labels, those functions construct large arrays with default
 translations. When many post types or taxonomies are registered, these
 calls start to accumulate into something considerable.
 This could be cached using a static variable, constructing them only once
 on each run of the script.

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


More information about the wp-trac mailing list