[wp-trac] [WordPress Trac] #56036: Call update_post_parent_caches in WP_Media_List_Table

WordPress Trac noreply at wordpress.org
Fri Aug 12 00:35:16 UTC 2022


#56036: Call update_post_parent_caches in WP_Media_List_Table
----------------------------------------+--------------------------
 Reporter:  spacedmonkey                |       Owner:  antpb
     Type:  enhancement                 |      Status:  assigned
 Priority:  normal                      |   Milestone:  6.1
Component:  Media                       |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  needs-patch good-first-bug  |     Focuses:  performance
----------------------------------------+--------------------------

Comment (by peterwilsoncc):

 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 [https://make.wordpress.org/core/handbook/contribute/git/github-pull-
 requests-for-code-review/ instructions for doing so in the handbook].

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56036#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list