Skip to content

Commit 6456e6e

Browse files
Docs: Use typed array notation for the $options parameter in some new functions.
Follow-up to [56445], [56508], [57013]. Props tmatsuur. Fixes #59904. git-svn-id: https://develop.svn.wordpress.org/trunk@57110 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 7304f61 commit 6456e6e

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/wp-includes/option.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,11 @@ function get_option( $option, $default_value = false ) {
256256
*
257257
* @global wpdb $wpdb WordPress database abstraction object.
258258
*
259-
* @param array $options An array of option names to be loaded.
259+
* @param string[] $options An array of option names to be loaded.
260260
*/
261261
function wp_prime_option_caches( $options ) {
262+
global $wpdb;
263+
262264
$alloptions = wp_load_alloptions();
263265
$cached_options = wp_cache_get_multiple( $options, 'options' );
264266
$notoptions = wp_cache_get( 'notoptions', 'options' );
@@ -283,7 +285,6 @@ function wp_prime_option_caches( $options ) {
283285
return;
284286
}
285287

286-
global $wpdb;
287288
$results = $wpdb->get_results(
288289
$wpdb->prepare(
289290
sprintf(
@@ -351,7 +352,7 @@ function wp_prime_option_caches_by_group( $option_group ) {
351352
*
352353
* @since 6.4.0
353354
*
354-
* @param array $options An array of option names to retrieve.
355+
* @param string[] $options An array of option names to retrieve.
355356
* @return array An array of key-value pairs for the requested options.
356357
*/
357358
function get_options( $options ) {
@@ -498,7 +499,7 @@ function wp_set_option_autoload_values( array $options ) {
498499
*
499500
* @see wp_set_option_autoload_values()
500501
*
501-
* @param array $options List of option names. Expected to not be SQL-escaped.
502+
* @param string[] $options List of option names. Expected to not be SQL-escaped.
502503
* @param string|bool $autoload Autoload value to control whether to load the options when WordPress starts up.
503504
* Accepts 'yes'|true to enable or 'no'|false to disable.
504505
* @return array Associative array of all provided $options as keys and boolean values for whether their autoload value

0 commit comments

Comments
 (0)