Changeset 4041
- Timestamp:
- 07/01/2012 11:50:30 PM (13 years ago)
- Location:
- branches/plugin/bbp-includes
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-core-actions.php
r4035 r4041 218 218 add_action( 'bbp_new_topic', 'bbp_global_access_auto_role' ); 219 219 add_action( 'bbp_new_reply', 'bbp_global_access_auto_role' ); 220 221 // Caches 222 add_action( 'bbp_new_forum_pre_extras', 'bbp_clean_post_cache' ); 223 add_action( 'bbp_new_forum_post_extras', 'bbp_clean_post_cache' ); 224 add_action( 'bbp_new_topic_pre_extras', 'bbp_clean_post_cache' ); 225 add_action( 'bbp_new_topic_post_extras', 'bbp_clean_post_cache' ); 226 add_action( 'bbp_new_reply_pre_extras', 'bbp_clean_post_cache' ); 227 add_action( 'bbp_new_reply_post_extras', 'bbp_clean_post_cache' ); 220 228 221 229 /** -
branches/plugin/bbp-includes/bbp-core-cache.php
r4012 r4041 119 119 } 120 120 new BBP_Skip_Children(); 121 122 /** General *******************************************************************/ 123 124 /** 125 * Will clean a post in the cache. 126 * 127 * Will call to clean the term object cache associated with the post ID. 128 * 129 * @since bbPress (r4040) 130 * 131 * @uses do_action() Calls 'bbp_clean_post_cache' on $id 132 * @param object|int $post The post object or ID to remove from the cache 133 */ 134 function bbp_clean_post_cache( $post ) { 135 global $wpdb; 136 137 // Bail if no post 138 $post = get_post( $post ); 139 if ( empty( $post ) ) 140 return; 141 142 wp_cache_delete( $post->ID, 'posts' ); 143 wp_cache_delete( $post->ID, 'post_meta' ); 144 145 clean_object_term_cache( $post->ID, $post->post_type ); 146 147 do_action( 'bbp_clean_post_cache', $post->ID, $post ); 148 149 // Child query types to clean 150 $post_types = array( bbp_get_topic_post_type(), bbp_get_forum_post_type(), bbp_get_reply_post_type() ); 151 152 // Loop through query types and clean caches 153 foreach ( $post_types as $post_type ) { 154 wp_cache_delete( 'bbp_get_forum_' . $post->ID . '_reply_id', 'bbpress' ); 155 wp_cache_delete( 'bbp_parent_' . $post->ID . '_type_' . $post_type . '_child_last_id', 'bbpress' ); 156 wp_cache_delete( 'bbp_parent_' . $post->ID . '_type_' . $post_type . '_child_count', 'bbpress' ); 157 wp_cache_delete( 'bbp_parent_public_' . $post->ID . '_type_' . $post_type . '_child_ids', 'bbpress' ); 158 wp_cache_delete( 'bbp_parent_all_' . $post->ID . '_type_' . $post_type . '_child_ids', 'bbpress' ); 159 } 160 161 // Invalidate parent caches 162 if ( $parent = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_type FROM $wpdb->posts WHERE ID = %d", $post->post_parent ) ) ) 163 bbp_clean_post_cache( $parent ); 164 } -
branches/plugin/bbp-includes/bbp-forum-functions.php
r4026 r4041 229 229 /** Additional Actions (Before Save) **************************************/ 230 230 231 do_action( 'bbp_new_forum_pre_extras' );232 233 231 // Bail if errors 234 232 if ( bbp_has_errors() ) … … 236 234 237 235 /** No Errors *************************************************************/ 236 237 do_action( 'bbp_new_forum_pre_extras', $forum_parent_id ); 238 238 239 239 // Add the content of the form to $forum_data as an array -
branches/plugin/bbp-includes/bbp-reply-functions.php
r4025 r4041 228 228 229 229 /** Additional Actions (Before Save) **************************************/ 230 231 do_action( 'bbp_new_reply_pre_extras' );232 230 233 231 // Bail if errors … … 236 234 237 235 /** No Errors *************************************************************/ 236 237 do_action( 'bbp_new_reply_pre_extras', $topic_id, $forum_id ); 238 238 239 239 // Add the content of the form to $reply_data as an array -
branches/plugin/bbp-includes/bbp-topic-functions.php
r4025 r4041 265 265 /** No Errors *************************************************************/ 266 266 267 do_action( 'bbp_new_topic_pre_extras' );267 do_action( 'bbp_new_topic_pre_extras', $forum_id ); 268 268 269 269 // Add the content of the form to $topic_data as an array.
Note: See TracChangeset
for help on using the changeset viewer.