Changeset 6585 for trunk/src/includes/core/cache.php
- Timestamp:
- 06/19/2017 05:05:18 AM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/includes/core/cache.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/core/cache.php
r6583 r6585 136 136 function bbp_clean_post_cache( $post_id = null, $post = null ) { 137 137 138 // Get the post object.139 if ( null !== $post ) {140 $post = get_post( $post );141 } else {142 $post = get_post( $post_id );143 }144 145 // Bail if no post146 if ( empty( $post ) ) {147 return;148 }149 150 138 // Child query types to clean 151 139 $post_types = array( … … 159 147 return; 160 148 } 161 162 // Be sure we haven't recached the post data163 wp_cache_delete( $post->ID, 'posts' );164 wp_cache_delete( $post->ID, 'post_meta' );165 166 // Clean the term cache for the given post167 clean_object_term_cache( $post->ID, $post->post_type );168 169 // Bump the last_changed cache170 wp_cache_set( 'last_changed', microtime(), 'bbpress_posts' );171 149 172 150 /** … … 182 160 // Invalidate parent caches 183 161 if ( ! empty( $post->post_parent ) ) { 184 bbp_clean_post_cache( $post->post_parent ); 162 clean_post_cache( $post->post_parent ); 163 164 // Only bump `last_changed` when forum-root is reached 165 } else { 166 wp_cache_set( 'last_changed', microtime(), 'bbpress_posts' ); 185 167 } 186 168 }
Note: See TracChangeset
for help on using the changeset viewer.