#56036 closed enhancement (fixed)
Call update_post_parent_caches in WP_Media_List_Table
| Reported by: | spacedmonkey | Owned by: | antpb |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.1 |
| Component: | Media | Version: | |
| Severity: | normal | Keywords: | good-first-bug has-patch needs-dev-note |
| Cc: | Focuses: | performance |
Description
Call update_post_parent_caches in WP_Media_List_Table to prime parent caches in a single request.
Change History (10)
#3
@
4 years ago
Hi,
I'm new here so I was wondering where in the WP_Media_List_Table class do I call the update_post_parent_caches function.
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
4 years ago
#6
@
4 years ago
Hi @jeawhanlee and welcome!
In the file src/wp-admin/includes/class-wp-media-list-table.php the call need to be added within the prepare_items() method.
At the end of the prepare_items() the media objects are available in the variable $wp_query->posts which can be passed to the update_post_parent_caches() function.
Most contributors use GitHub to submit patches these days, you can find the instructions for doing so in the handbook.
This ticket was mentioned in PR #3107 on WordPress/wordpress-develop by alaca.
4 years ago
#7
- Keywords has-patch added; needs-patch removed
Call update_post_parent_caches in WP_Media_List_Table to prime parent caches in a single request.
Trac ticket: https://core.trac.wordpress.org/ticket/56036
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
#56037 was marked as a duplicate.