[wp-trac] [WordPress Trac] #58962: Provide a way to load multiple specific options with a single database request
WordPress Trac
noreply at wordpress.org
Wed Oct 25 10:12:52 UTC 2023
#58962: Provide a way to load multiple specific options with a single database
request
-------------------------------------------------+-------------------------
Reporter: flixos90 | Owner: flixos90
Type: enhancement | Status: reopened
Priority: normal | Milestone: 6.4
Component: Options, Meta APIs | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests has-dev- | Focuses:
note dev-reviewed | performance
-------------------------------------------------+-------------------------
Comment (by SergeyBiryukov):
Replying to [comment:44 joemcgill]:
> These new functions do seem to have the same functional purpose as
existing `_prime_{thing}_cache` functions, as I mentioned [comment:18 in a
previous comment]. Assuming we can come to agreement on that point, it
seems to me like we have 3 options:
>
> 1. Leave things as they currently stand and punt the naming conversation
to a future release.
> 2. Update these new function names to `_prime_options_cache()` and
`_prime_options_cache_by_group()`, to be consistent with other cache
priming functions in the meantime.
> 3. Update the new function names to what we anticipate potentially
renaming the other functions.
I would prefer option 2 here for consistency with the existing functions,
as per comment:14:
* `_prime_post_caches()`
* `_prime_post_parent_id_caches()` (new in 6.4)
* `_prime_site_caches()`
* `_prime_term_caches()`
* `_prime_comment_caches()`
* `_prime_network_caches()`
For the naming, I would suggest:
* `_prime_option_caches()`
* `_prime_option_caches_by_group()`
The underscore here, while being a vestige of the older naming convention,
would give us more flexibility in renaming or deprecating these functions
following a holistic approach in 6.5.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58962#comment:46>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list