Make WordPress Core

Changeset 57004

Timestamp:
10/24/2023 02:34:43 PM (10 months ago)
Author:
flixos90
Message:

Options, Meta APIs: Rename prime_options() to wp_load_options().

This clearly separates these functions which are intended to be used by external developers from the existing _prime_*_caches() functions which are primarily intended for internal usage. The term "load" is additionally more accessible than "prime".

This changeset renames the above function, as well as the wrapper function prime_options_by_group() to wp_load_options_by_group().

Props peterwilsoncc, joemcgill, hellofromTonya, poran766, flixos90.
Merges [56990] to the 6.4 branch.
Fixes #58962.

Location:
branches/6.4
Files:
2 deleted
2 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/6.4

  • branches/6.4/src/wp-includes/option.php

    r56946 r57004  
    249249
    250250/**
    251  * Primes specific options into the cache with a single database query.
    252  *
    253  * Only options that do not already exist in cache will be primed.
     251 * s specific options into the cache with a single database query.
     252 *
     253 * Only options that do not already exist in cache will be ed.
    254254 *
    255255 * @since 6.4.0
     
    257257 * @global wpdb $wpdb WordPress database abstraction object.
    258258 *
    259  * @param array $options An array of option names to be primed.
    260  */
    261 function prime_options( $options ) {
     259 * @param array $options An array of option names to be ed.
     260 */
     261function _options( $options ) {
    262262    $alloptions     = wp_load_alloptions();
    263263    $cached_options = wp_cache_get_multiple( $options, 'options' );
     
    271271    }
    272272
    273     // Bail early if there are no options to be primed.
     273    // Bail early if there are no options to be ed.
    274274    if ( empty( $options_to_prime ) ) {
    275275        return;
     
    322322
    323323/**
    324  * Primes all options registered with a specific option group.
     324 * s all options registered with a specific option group.
    325325 *
    326326 * @since 6.4.0
     
    328328 * @global array $new_allowed_options
    329329 *
    330  * @param string $option_group The option group to prime options for.
    331  */
    332 function prime_options_by_group( $option_group ) {
     330 * @param string $option_group The option group to options for.
     331 */
     332function _options_by_group( $option_group ) {
    333333    global $new_allowed_options;
    334334
    335335    if ( isset( $new_allowed_options[ $option_group ] ) ) {
    336         prime_options( $new_allowed_options[ $option_group ] );
     336        _options( $new_allowed_options[ $option_group ] );
    337337    }
    338338}
     
    341341 * Retrieves multiple options.
    342342 *
    343  * Options are primed as necessary first in order to use a single database query at most.
     343 * Options are ed as necessary first in order to use a single database query at most.
    344344 *
    345345 * @since 6.4.0
     
    349349 */
    350350function get_options( $options ) {
    351     prime_options( $options );
     351    _options( $options );
    352352
    353353    $result = array();
Note: See TracChangeset for help on using the changeset viewer.