Opened 2 years ago
Closed 2 years ago
#54128 closed enhancement (duplicate)
Consider caching the outputs for label arrays in get_post_type_labels and get_taxonomy_labels
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | minor | Version: | |
Component: | Posts, Post Types | Keywords: | |
Focuses: | performance | Cc: |
Description
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.
Change History (1)
Note: See
TracTickets for help on using
tickets.
Hi there, welcome to WordPress Trac!
Thanks for the ticket, we're already tracking this enhancement in #26746.