Opened 5 years ago
Closed 5 years ago
#44792 closed defect (bug) (duplicate)
Add filter to get_post_class to solve get_taxonomies performance issues
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.9.8 |
Component: | Posts, Post Types | Keywords: | |
Focuses: | Cc: |
Description
We have uncovered while running WooCommerce dashboard (but could also effect anything using WP_Posts_List_Table) that on a post type with 20 posts per page this calls get_post_class() 20 times, which in turn queries all public taxonomies by get_taxonomies() 20 times.
If you have lots of taxonomies this causes huge slow downs when accessing the page.
A 20 product per page WooCommerce site loaded in 20 seconds, if I remove the get_taxonomies call it reduces it by 50%. Can you add a filter to this so we can stop this depending on the page you are on? - in my case if I am on the product listings page in the dashboard I need to restrict this occurring to reduce the load times.
Change History (2)
Note: See
TracTickets for help on using
tickets.
This is within wp-includes/post-template.php line 510