[wp-trac] [WordPress Trac] #63279: Improve `media_library_months_with_files` inside `wp_enqueue_media()`
WordPress Trac
noreply at wordpress.org
Wed Feb 25 01:17:44 UTC 2026
#63279: Improve `media_library_months_with_files` inside `wp_enqueue_media()`
-------------------------+-----------------------------
Reporter: apermo | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Media | Version: 4.7.4
Severity: normal | Resolution:
Keywords: has-patch | Focuses: performance
-------------------------+-----------------------------
Comment (by westonruter):
Replying to [comment:10 apermo]:
> Two related two attachments and basically copy and paste. The other two
slight variants but close.
>
> I'm thinking of at least using the newly introduced function in both
cases. What are your thoughts? Make a reuseable function for all 4, or
just the 2 attachments queries?
I think reusing the same query in all cases would make the most sense if
it had caching built into it. This would mean moving the transient call
inside of the function. In that case, it would only make sense the two
attachment instances.
https://github.com/WordPress/wordpress-
develop/pull/8688#discussion_r2850309680
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63279#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list