Skip to:
Content

BuddyPress.org

Changeset 13398


Ignore:
Timestamp:
01/07/2023 01:21:39 AM (15 months ago)
Author:
espellcaste
Message:

Make the bp_core_clear_cache function pluggable.

Closes https://github.com/buddypress/buddypress/pull/50
Fixes #8462

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-cache.php

    r13395 r13398  
    1414defined( 'ABSPATH' ) || exit;
    1515
    16 /**
    17  * Prune the WP Super Cache.
    18  *
    19  * When WP Super Cache is installed, this function will clear cached pages
    20  * so that success/error messages or time-sensitive content are not cached.
    21  *
    22  * @since 1.0.0
    23  *
    24  * @see prune_super_cache()
    25  *
    26  * @return int
    27  */
    28 function bp_core_clear_cache() {
    29     global $cache_path;
    30 
    31     if ( function_exists( 'prune_super_cache' ) ) {
    32 
    33         /**
    34          * Fires before the pruning of WP Super Cache.
    35          *
    36          * @since 1.0.0
    37          */
    38         do_action( 'bp_core_clear_cache' );
    39         return prune_super_cache( $cache_path, true );
     16if ( ! function_exists( 'bp_core_clear_cache' ) ) {
     17
     18    /**
     19     * Prune the WP Super Cache.
     20     *
     21     * When WP Super Cache is installed, this function will clear cached pages
     22     * so that success/error messages or time-sensitive content are not cached.
     23     *
     24     * @since 1.0.0
     25     *
     26     * @global string $cache_path Path directory.
     27     *
     28     * @see prune_super_cache()
     29     *
     30     * @return integer
     31     */
     32    function bp_core_clear_cache() {
     33        global $cache_path;
     34
     35        if ( function_exists( 'prune_super_cache' ) ) {
     36
     37            /**
     38             * Fires before the pruning of WP Super Cache.
     39             *
     40             * @since 1.0.0
     41             */
     42            do_action( 'bp_core_clear_cache' );
     43
     44            return prune_super_cache( $cache_path, true );
     45        }
    4046    }
    4147}
Note: See TracChangeset for help on using the changeset viewer.