| @@ 179-191 (lines=13) @@ | ||
| 176 | $all = $get_all == true ? '' : 'short'; |
|
| 177 | $details = wp_cache_get( $blog_id . $all, 'blog-details' ); |
|
| 178 | ||
| 179 | if ( $details ) { |
|
| 180 | if ( ! is_object( $details ) ) { |
|
| 181 | if ( $details == -1 ) { |
|
| 182 | return false; |
|
| 183 | } else { |
|
| 184 | // Clear old pre-serialized objects. Cache clients do better with that. |
|
| 185 | wp_cache_delete( $blog_id . $all, 'blog-details' ); |
|
| 186 | unset($details); |
|
| 187 | } |
|
| 188 | } else { |
|
| 189 | return $details; |
|
| 190 | } |
|
| 191 | } |
|
| 192 | ||
| 193 | // Try the other cache. |
|
| 194 | if ( $get_all ) { |
|
| @@ 196-212 (lines=17) @@ | ||
| 193 | // Try the other cache. |
|
| 194 | if ( $get_all ) { |
|
| 195 | $details = wp_cache_get( $blog_id . 'short', 'blog-details' ); |
|
| 196 | } else { |
|
| 197 | $details = wp_cache_get( $blog_id, 'blog-details' ); |
|
| 198 | // If short was requested and full cache is set, we can return. |
|
| 199 | if ( $details ) { |
|
| 200 | if ( ! is_object( $details ) ) { |
|
| 201 | if ( $details == -1 ) { |
|
| 202 | return false; |
|
| 203 | } else { |
|
| 204 | // Clear old pre-serialized objects. Cache clients do better with that. |
|
| 205 | wp_cache_delete( $blog_id, 'blog-details' ); |
|
| 206 | unset($details); |
|
| 207 | } |
|
| 208 | } else { |
|
| 209 | return $details; |
|
| 210 | } |
|
| 211 | } |
|
| 212 | } |
|
| 213 | ||
| 214 | if ( empty($details) ) { |
|
| 215 | $details = WP_Site::get_instance( $blog_id ); |
|