[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 14:13:51 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                                           |  performance
-------------------------------------------------+-------------------------

Comment (by flixos90):

 Thanks @hellofromTonya @joemcgill.

 Replying to [comment:22 joemcgill]:
 > To make the distinction and intent even more clear, I would consider
 renaming these to
 >
 > * `wp_load_options()`
 > * `wp_load_options_group()`

 I like the idea of separating the names more obviously. Only one suggested
 change: The second should remain `...options_by_group()` IMO because it's
 loading options, not an option group. The two functions are conceptually
 doing the same thing, and the latter is a convenience wrapper. So IMO we
 shouldn't change the noun/objective of ''what'' is loaded.

 The other potential concern is that existing option functions don't use
 the `wp_` prefix, but I'm not opposed to introducing it here - also since
 the option autoload functions from #58964 already went with `wp_` anyway.
 Just sharing that as a further naming consideration, but I'm fine with
 having the `wp_` prefix on them.

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


More information about the wp-trac mailing list