Making WordPress.org

Changeset 13540


Ignore:
Timestamp:
04/16/2024 06:26:45 AM (8 months ago)
Author:
dd32
Message:

Support Forums: Clear the rating caches upon a review being archived.

See #4275.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-ratings-compat.php

    r13509 r13540  
    8282            add_filter( 'bbp_get_topic_title', array( $this, 'feed_append_rating' ), 10, 2 );
    8383        }
     84
     85        // Clear the review/ratings caches upon archive.
     86        add_action( 'wporg_bbp_archived_topic', array( $this, 'wporg_bbp_archived_topic' ) );
    8487    }
    8588
     
    593596        return $title;
    594597    }
     598
     599    /**
     600     * Clear the rating caches on topic archive.
     601     */
     602    public function wporg_bbp_archived_topic( $post_id ) {
     603        // Clear the rating caches.
     604        \WPORG_Ratings::clear_cache(
     605            $post_id,
     606            $this->compat,
     607            $this->slug,
     608            bbp_get_topic_author_id( $post_id )
     609        );
     610    }
    595611}
Note: See TracChangeset for help on using the changeset viewer.