Changeset 63354 for trunk/src/wp-includes/class-wp-site.php
- Timestamp:
- 08/26/2026 10:20:49 PM (3 days ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/class-wp-site.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-site.php
r62640 r63354 160 160 * 161 161 * @since 4.5.0 162 * @since 7.2.0 Cache values that are neither a site object nor the -1 miss sentinel are now treated as a cache miss and replaced. 162 163 * 163 164 * @global wpdb $wpdb WordPress database abstraction object. … … 176 177 $_site = wp_cache_get( $site_id, 'sites' ); 177 178 178 if ( false === $_site ) { 179 // A cached -1 records a previous lookup that found nothing. Any other non-numeric value that is not a site object is treated as a cache miss. 180 if ( 181 ( ! is_object( $_site ) || ! isset( $_site->blog_id ) ) 182 && 183 ! is_numeric( $_site ) 184 ) { 179 185 $_site = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->blogs} WHERE blog_id = %d LIMIT 1", $site_id ) ); 180 186 … … 183 189 } 184 190 185 wp_cache_add( $site_id, $_site, 'sites' ); 191 // Not wp_cache_add(), since an unusable cached value may still be present and must be replaced. 192 wp_cache_set( $site_id, $_site, 'sites' ); 186 193 } 187 194
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)