Changeset 54637 for trunk/src/wp-includes/ms-network.php
- Timestamp:
- 10/18/2022 06:14:01 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-network.php
r54080 r54637 85 85 $network_ids = (array) $ids; 86 86 wp_cache_delete_multiple( $network_ids, 'networks' ); 87 wp_cache_delete_multiple( $network_ids, 'site_meta' );88 87 89 88 foreach ( $network_ids as $id ) { … … 109 108 * 110 109 * @since 4.6.0 111 * @since 6.1.0 Introduced the `$update_meta_cache` parameter.112 110 * 113 * @param array $networks Array of network row objects. 114 * @param bool $update_meta_cache Whether to update site meta cache. Default true. 111 * @param array $networks Array of network row objects. 115 112 */ 116 function update_network_cache( $networks , $update_meta_cache = true) {113 function update_network_cache( $networks ) { 117 114 $data = array(); 118 115 foreach ( (array) $networks as $network ) { 119 116 $data[ $network->id ] = $network; 120 117 } 121 122 118 wp_cache_add_multiple( $data, 'networks' ); 123 if ( $update_meta_cache ) {124 $network_ids = array_keys( $data );125 update_meta_cache( 'site', $network_ids );126 }127 119 } 128 120 … … 131 123 * 132 124 * @since 4.6.0 133 * @since 6.1.0 Introduced the `$update_meta_cache` parameter.134 125 * @since 6.1.0 This function is no longer marked as "private". 135 126 * … … 137 128 * @global wpdb $wpdb WordPress database abstraction object. 138 129 * 139 * @param array $network_ids Array of network IDs. 140 * @param bool $update_meta_cache Whether to update site meta cache. Default true. 130 * @param array $network_ids Array of network IDs. 141 131 */ 142 function _prime_network_caches( $network_ids , $update_meta_cache = true) {132 function _prime_network_caches( $network_ids ) { 143 133 global $wpdb; 144 134 … … 147 137 $fresh_networks = $wpdb->get_results( sprintf( "SELECT $wpdb->site.* FROM $wpdb->site WHERE id IN (%s)", implode( ',', array_map( 'intval', $non_cached_ids ) ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared 148 138 149 update_network_cache( $fresh_networks , $update_meta_cache);139 update_network_cache( $fresh_networks ); 150 140 } 151 141 }
Note: See TracChangeset
for help on using the changeset viewer.