[wp-trac] [WordPress Trac] #58757: Performance issue has_content method in WP_Widget_Media_Gallery

WordPress Trac noreply at wordpress.org
Mon Sep 4 16:31:45 UTC 2023


#58757: Performance issue has_content method in WP_Widget_Media_Gallery
---------------------------------------------+-----------------------------
 Reporter:  spacedmonkey                     |       Owner:
                                             |  niravsherasiya7707
     Type:  enhancement                      |      Status:  closed
 Priority:  normal                           |   Milestone:  6.4
Component:  Widgets                          |     Version:
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  good-first-bug has-patch commit  |     Focuses:  performance
---------------------------------------------+-----------------------------
Changes (by spacedmonkey):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"56512" 56512]:
 {{{
 #!CommitTicketReference repository="" revision="56512"
 Widgets: Improve performance of has_content method in
 WP_Widget_Media_Gallery class.

 In the method `WP_Widget_Media_Gallery::has_content` call
 `_prime_post_caches` before the foreach loop. This ensures that the post
 objects are primed in memory before trying to access the post object in
 `get_post_type`.

 Props niravsherasiya7707, spacedmonkey, mukesh27.
 Fixes #58757.
 }}}

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


More information about the wp-trac mailing list