Skip to content

Commit

Permalink
Docs: Use typed array notation for the $options parameter in some n…
Browse files Browse the repository at this point in the history
…ew 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
  • Loading branch information
SergeyBiryukov committed Nov 14, 2023
1 parent 7304f61 commit 6456e6e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/wp-includes/option.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand All @@ -283,7 +285,6 @@ function wp_prime_option_caches( $options ) {
return;
}

global $wpdb;
$results = $wpdb->get_results(
$wpdb->prepare(
sprintf(
Expand Down Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6456e6e

Please sign in to comment.