From 6456e6ea8b4ef25762a7c94821011d42a0c6da99 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 14 Nov 2023 12:42:52 +0000 Subject: [PATCH] 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 --- src/wp-includes/option.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/option.php b/src/wp-includes/option.php index 73b38c6514990..36bfcf6755414 100644 --- a/src/wp-includes/option.php +++ b/src/wp-includes/option.php @@ -256,9 +256,11 @@ function get_option( $option, $default_value = false ) { * * @global wpdb $wpdb WordPress database abstraction object. * - * @param array $options An array of option names to be loaded. + * @param string[] $options An array of option names to be loaded. */ function wp_prime_option_caches( $options ) { + global $wpdb; + $alloptions = wp_load_alloptions(); $cached_options = wp_cache_get_multiple( $options, 'options' ); $notoptions = wp_cache_get( 'notoptions', 'options' ); @@ -283,7 +285,6 @@ function wp_prime_option_caches( $options ) { return; } - global $wpdb; $results = $wpdb->get_results( $wpdb->prepare( sprintf( @@ -351,7 +352,7 @@ function wp_prime_option_caches_by_group( $option_group ) { * * @since 6.4.0 * - * @param array $options An array of option names to retrieve. + * @param string[] $options An array of option names to retrieve. * @return array An array of key-value pairs for the requested options. */ function get_options( $options ) { @@ -498,7 +499,7 @@ function wp_set_option_autoload_values( array $options ) { * * @see wp_set_option_autoload_values() * - * @param array $options List of option names. Expected to not be SQL-escaped. + * @param string[] $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