#56036 closed enhancement (fixed)
Call update_post_parent_caches in WP_Media_List_Table
Reported by: | spacedmonkey | Owned by: | antpb |
---|---|---|---|
Milestone: | 6.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Media | Keywords: | good-first-bug has-patch needs-dev-note |
Focuses: | performance | Cc: |
Description
Call update_post_parent_caches
in WP_Media_List_Table
to prime parent caches in a single request.
Change History (10)
#3
@
2 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.
2 years ago
#5
@
2 years ago
- Owner set to antpb
- Status changed from new to assigned
Assigning myself to investigate this one.
#6
@
2 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.
2 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
#56037 was marked as a duplicate.