From ead01cff583e9efeec40a399290884327d4a22a6 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Fri, 27 Oct 2023 00:02:20 +0000 Subject: [PATCH] Options, Meta APIs: Rename option cache priming functions. Rename the option cache priming functions to more closely follow the naming convention used by other cache priming functions. * `wp_load_options()` becomes `wp_prime_option_caches()` * `wp_load_options_by_group()` becomes `wp_prime_option_caches_by_group()` The unit test files and classes are renamed accordingly. Unlike the existing cache priming functions, these functions were introduced with the intention of being public so use the `wp_` prefix rather than the `_` prefix used by the functions initially introduced as private functions but since made public. Follow up to [56445],[56990]. Props flixos90, peterwilsoncc, joemcgill, SergeyBiryukov, desrosj. Reviewed by flixos90. Merges [57013] to the 6.4 branch. Fixes #58962. Built from https://develop.svn.wordpress.org/branches/6.4@57016 git-svn-id: http://core.svn.wordpress.org/branches/6.4@56527 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/option.php | 12 ++++++------ wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/wp-includes/option.php b/wp-includes/option.php index 4e3886630d..e587931173 100644 --- a/wp-includes/option.php +++ b/wp-includes/option.php @@ -248,7 +248,7 @@ function get_option( $option, $default_value = false ) { } /** - * Loads specific options into the cache with a single database query. + * Primes specific options into the cache with a single database query. * * Only options that do not already exist in cache will be loaded. * @@ -258,7 +258,7 @@ function get_option( $option, $default_value = false ) { * * @param array $options An array of option names to be loaded. */ -function wp_load_options( $options ) { +function wp_prime_option_caches( $options ) { $alloptions = wp_load_alloptions(); $cached_options = wp_cache_get_multiple( $options, 'options' ); @@ -321,7 +321,7 @@ function wp_load_options( $options ) { } /** - * Loads all options registered with a specific option group. + * Primes the cache of all options registered with a specific option group. * * @since 6.4.0 * @@ -329,11 +329,11 @@ function wp_load_options( $options ) { * * @param string $option_group The option group to load options for. */ -function wp_load_options_by_group( $option_group ) { +function wp_prime_option_caches_by_group( $option_group ) { global $new_allowed_options; if ( isset( $new_allowed_options[ $option_group ] ) ) { - wp_load_options( $new_allowed_options[ $option_group ] ); + wp_prime_option_caches( $new_allowed_options[ $option_group ] ); } } @@ -348,7 +348,7 @@ function wp_load_options_by_group( $option_group ) { * @return array An array of key-value pairs for the requested options. */ function get_options( $options ) { - wp_load_options( $options ); + wp_prime_option_caches( $options ); $result = array(); foreach ( $options as $option ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 2ffb77ac96..a214cbf04a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.4-RC2-57014'; +$wp_version = '6.4-RC2-57016'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.