mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Cache: Use wp_cache_*_multiple() in core functions.
Implement the `wp_cache_add_multiple`, `wp_cache_set_multiple` and `wp_cache_delete_multiple` in a number of core functions after they were introduced in [52700] Props: spacedmonkey, adamsilverstein, flixos90, mitogh. Fixes: #55029. git-svn-id: https://develop.svn.wordpress.org/trunk@52707 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -344,13 +344,15 @@ function wp_load_core_site_options( $network_id = null ) {
|
||||
$core_options_in = "'" . implode( "', '", $core_options ) . "'";
|
||||
$options = $wpdb->get_results( $wpdb->prepare( "SELECT meta_key, meta_value FROM $wpdb->sitemeta WHERE meta_key IN ($core_options_in) AND site_id = %d", $network_id ) );
|
||||
|
||||
$data = array();
|
||||
foreach ( $options as $option ) {
|
||||
$key = $option->meta_key;
|
||||
$cache_key = "{$network_id}:$key";
|
||||
$option->meta_value = maybe_unserialize( $option->meta_value );
|
||||
|
||||
wp_cache_set( $cache_key, $option->meta_value, 'site-options' );
|
||||
$data[ $cache_key ] = $option->meta_value;
|
||||
}
|
||||
wp_cache_set_multiple( $data, 'site-options' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user