Make WordPress Core

Changes between Initial Version and Version 5 of Ticket #59738


Ignore:
Timestamp:
10/27/2023 01:09:25 AM (2 years ago)
Author:
peterwilsoncc
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #59738

    • Property Owner set to flixos90
    • Property Status changed from new to reviewing
    • Property Summary changed from `wp_load_options()` makes DB queries for known non-existent options (notoptions). to `wp_prime_option_caches()` makes DB queries for known non-existent options (notoptions).
    • Property Milestone changed from Awaiting Review to 6.4
  • Ticket #59738 – Description

    initial v5  
    1 The function `wp_load_options()` is intended to reduce the number of database queries by allowing the caching of options in bulk.
     1The function `wp_prime_option_caches()` is intended to reduce the number of database queries by allowing the caching of options in bulk.
    22
    33When determining which options to query for, it doesn't check the `notoptions` cache so re-queries the database for options that are known not to exist.
     
    1111$initial_num_queries = get_num_queries();
    1212=> int(10) ### Will differ depending on set up
    13 wp> wp_load_options( array( 'nonexistent_option' ) );
     13wp> wp_prime_option_caches( array( 'nonexistent_option' ) );
    1414=> NULL
    1515wp> get_num_queries() - $initial_num_queries;