wp/wp-includes/ms-network.php
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
    80 
    80 
    81 	if ( ! empty( $_wp_suspend_cache_invalidation ) ) {
    81 	if ( ! empty( $_wp_suspend_cache_invalidation ) ) {
    82 		return;
    82 		return;
    83 	}
    83 	}
    84 
    84 
    85 	foreach ( (array) $ids as $id ) {
    85 	$network_ids = (array) $ids;
    86 		wp_cache_delete( $id, 'networks' );
    86 	wp_cache_delete_multiple( $network_ids, 'networks' );
    87 
    87 
       
    88 	foreach ( $network_ids as $id ) {
    88 		/**
    89 		/**
    89 		 * Fires immediately after a network has been removed from the object cache.
    90 		 * Fires immediately after a network has been removed from the object cache.
    90 		 *
    91 		 *
    91 		 * @since 4.6.0
    92 		 * @since 4.6.0
    92 		 *
    93 		 *
   108  * @since 4.6.0
   109  * @since 4.6.0
   109  *
   110  *
   110  * @param array $networks Array of network row objects.
   111  * @param array $networks Array of network row objects.
   111  */
   112  */
   112 function update_network_cache( $networks ) {
   113 function update_network_cache( $networks ) {
       
   114 	$data = array();
   113 	foreach ( (array) $networks as $network ) {
   115 	foreach ( (array) $networks as $network ) {
   114 		wp_cache_add( $network->id, $network, 'networks' );
   116 		$data[ $network->id ] = $network;
   115 	}
   117 	}
       
   118 	wp_cache_add_multiple( $data, 'networks' );
   116 }
   119 }
   117 
   120 
   118 /**
   121 /**
   119  * Adds any networks from the given IDs to the cache that do not already exist in cache.
   122  * Adds any networks from the given IDs to the cache that do not already exist in cache.
   120  *
   123  *