[wp-trac] [WordPress Trac] #58962: Provide a way to load multiple specific options with a single database request

WordPress Trac noreply at wordpress.org
Mon Oct 23 22:07:58 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-feedback                              |  performance
-------------------------------------------------+-------------------------

Comment (by flixos90):

 Regardless of whether the existing `_prime_*_caches()` function are now
 meant to be used by others or not, I don't think it makes sense to use an
 underscore prefixed name for a public function, for the reasons outlined
 above.

 The existing functions were already introduced before, and given they are
 intended to be public now, their names are technically not appropriate. Of
 course I understand why, it is because the use-case for the function would
 have changed after their introduction. But that is not the case for new
 functions we're introducing now. Therefore, I don't think it makes sense
 to knowingly make a naming "mistake" on a new function when we don't have
 to.

 Last but not least, using the term "load" as @joemcgill suggested is
 easier to understand than "prime", ''and'' it is aligned with the closely
 related `wp_load_alloptions()` and `wp_load_core_site_options()` functions
 and their names. In fact, the functions are introduced as a replacement
 for relying on autoloaded options ("alloptions").

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


More information about the wp-trac mailing list