[wp-trac] [WordPress Trac] #59904: Change the data type of parameter descriptions such as wp_set_option_autoload_values function from array to string[].

WordPress Trac noreply at wordpress.org
Tue Nov 14 06:45:33 UTC 2023


#59904: Change the data type of parameter descriptions such as
wp_set_option_autoload_values function from array to string[].
--------------------------------+-----------------------------
 Reporter:  tmatsuur            |      Owner:  (none)
     Type:  feature request     |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Options, Meta APIs  |    Version:  6.4
 Severity:  normal              |   Keywords:
  Focuses:  docs                |
--------------------------------+-----------------------------
 In the functions related to the newly added options, the data type of the
 $options parameter is listed as "array".

 wp_prime_option_caches()
 {{{
  * @param array $options An array of option names to be loaded.
  */
 function wp_prime_option_caches( $options ) {
 }}}

 get_options()
 {{{
  * @param array $options An array of option names to retrieve.
  * @return array An array of key-value pairs for the requested options.
  */
 function get_options( $options ) {
 }}}

 wp_set_options_autoload()
 {{{
  * @param array       $options  List of option names. Expected to not be
 SQL-escaped.
  * @param string|bool $autoload Autoload value to control whether to load
 the options when WordPress starts up.
  *                              Accepts 'yes'|true to enable or 'no'|false
 to disable.
  * @return array Associative array of all provided $options as keys and
 boolean values for whether their autoload value
  *               was updated.
  */
 function wp_set_options_autoload( array $options, $autoload ) {
 }}}

 I think `string[]` would be better than `array` for $options for these
 three functions.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59904>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list