Changeset 37894
- Timestamp:
- 06/28/2016 09:26:48 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-blogs.php
r37893 r37894 1116 1116 1117 1117 /** 1118 * Removes a network from the object cache. 1119 * 1120 * @since 4.6.0 1121 * 1122 * @param int|array $ids Network ID or an array of network IDs to remove from cache. 1123 */ 1124 function clean_network_cache( $ids ) { 1125 foreach ( (array) $ids as $id ) { 1126 wp_cache_delete( $id, 'networks' ); 1127 1128 /** 1129 * Fires immediately after a network has been removed from the object cache. 1130 * 1131 * @since 4.6.0 1132 * 1133 * @param int $id Network ID. 1134 */ 1135 do_action( 'clean_network_cache', $id ); 1136 } 1137 1138 wp_cache_set( 'last_changed', microtime(), 'networks' ); 1139 } 1140 1141 /** 1142 * Updates the network cache of given networks. 1143 * 1144 * Will add the networks in $networks to the cache. If network ID already exists 1145 * in the network cache then it will not be updated. The network is added to the 1146 * cache using the network group with the key using the ID of the networks. 1147 * 1148 * @since 4.6.0 1149 * 1150 * @param array $networks Array of network row objects. 1151 */ 1152 function update_network_cache( $networks ) { 1153 foreach ( (array) $networks as $network ) { 1154 wp_cache_add( $network->id, $network, 'networks' ); 1155 } 1156 } 1157 1158 /** 1159 * Adds any networks from the given IDs to the cache that do not already exist in cache. 1160 * 1161 * @since 4.6.0 1162 * @access private 1163 * 1164 * @see update_network_cache() 1165 * @global wpdb $wpdb WordPress database abstraction object. 1166 * 1167 * @param array $network_ids Array of network IDs. 1168 */ 1169 function _prime_network_caches( $network_ids ) { 1170 global $wpdb; 1171 1172 $non_cached_ids = _get_non_cached_ids( $network_ids, 'networks' ); 1173 if ( !empty( $non_cached_ids ) ) { 1174 $fresh_networks = $wpdb->get_results( sprintf( "SELECT $wpdb->site.* FROM $wpdb->site WHERE id IN (%s)", join( ",", array_map( 'intval', $non_cached_ids ) ) ) ); 1175 1176 update_network_cache( $fresh_networks ); 1177 } 1178 } 1179 1180 /** 1118 1181 * Handler for updating the blog date when a post is published or an already published post is changed. 1119 1182 * -
trunk/src/wp-settings.php
r37890 r37894 116 116 if ( is_multisite() ) { 117 117 require( ABSPATH . WPINC . '/class-wp-site-query.php' ); 118 require( ABSPATH . WPINC . '/class-wp-network-query.php' ); 118 119 require( ABSPATH . WPINC . '/ms-blogs.php' ); 119 120 require( ABSPATH . WPINC . '/ms-settings.php' );
Note: See TracChangeset
for help on using the changeset viewer.