Changeset 5950 for sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-users.php
- Timestamp:
- 09/21/2017 07:25:49 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-users.php
r5866 r5950 33 33 34 34 // Clear user's topics and reviews count cache. 35 add_action( 'bbp_new_topic', array( $this, 'clear_user_topics_count_cache' ), 10, 4 ); 35 add_action( 'bbp_new_topic', array( $this, 'clear_user_topics_count_cache' ) ); 36 add_action( 'bbp_spammed_topic', array( $this, 'clear_user_topics_count_cache' ) ); 37 add_action( 'bbp_unspammed_topic', array( $this, 'clear_user_topics_count_cache' ) ); 38 add_action( 'bbp_approved_topic', array( $this, 'clear_user_topics_count_cache' ) ); 39 add_action( 'bbp_unapproved_topic', array( $this, 'clear_user_topics_count_cache' ) ); 40 add_action( 'wporg_bbp_archived_topic', array( $this, 'clear_user_topics_count_cache' ) ); 41 add_action( 'wporg_bbp_unarchived_topic', array( $this, 'clear_user_topics_count_cache' ) ); 36 42 } 37 43 … … 348 354 * Clear user's topics and reviews count cache. 349 355 * 350 * @param int $topic_id Topic ID. 351 * @param int $forum_id Forum ID. 352 * @param array $anonymous_data Anonymous poster data. 353 * @param int $topic_author Topic author ID. 354 */ 355 public function clear_user_topics_count_cache( $topic_id, $forum_id, $anonymous_data, $topic_author ) { 356 if ( Plugin::REVIEWS_FORUM_ID != $forum_id ) { 357 wp_cache_delete( $topic_author, 'user-topics-count' ); 356 * @param int $topic_id Topic ID. 357 */ 358 public function clear_user_topics_count_cache( $topic_id ) { 359 $post = get_post( $topic_id ); 360 361 if ( Plugin::REVIEWS_FORUM_ID != $post->post_parent ) { 362 wp_cache_delete( $post->post_author, 'user-topics-count' ); 358 363 } else { 359 wp_cache_delete( $ topic_author, 'user-reviews-count' );364 wp_cache_delete( $post->post_author, 'user-reviews-count' ); 360 365 } 361 366 }
Note: See TracChangeset
for help on using the changeset viewer.