gc_cache

gc_cache

Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: wp-super-cache.1.9.4

do_action('gc_cache') is found 7 times:

  • /wp-cache-phase2.php line 3143
    	$dir = get_current_url_supercache_dir( $post_id );
    	wp_cache_debug( "wp_cache_post_id_gc post_id: $post_id " . get_permalink( $post_id ) . " clearing cache in $dir.", 4 );
    	if ( $all ) {
    		prune_super_cache( $dir, true, true );
    		do_action( 'gc_cache', 'prune', $permalink );
    		@rmdir( $dir );
    		$supercache_home = get_supercache_dir();
    		wp_cache_debug( "wp_cache_post_id_gc clearing cache in {$supercache_home}page/." );
    		prune_super_cache( $supercache_home . 'page/', true );
    		do_action( 'gc_cache', 'prune', 'page/' );
    	} else {
    
  • /wp-cache-phase2.php line 3148
    		@rmdir( $dir );
    		$supercache_home = get_supercache_dir();
    		wp_cache_debug( "wp_cache_post_id_gc clearing cache in {$supercache_home}page/." );
    		prune_super_cache( $supercache_home . 'page/', true );
    		do_action( 'gc_cache', 'prune', 'page/' );
    	} else {
    		wp_cache_debug( "wp_cache_post_id_gc clearing cached index files in $dir.", 4 );
    		prune_super_cache( $dir, true, true );
    		do_action( 'gc_cache', 'prune', $permalink );
    	}
    	return true;
    
  • /wp-cache-phase2.php line 3152
    		do_action( 'gc_cache', 'prune', 'page/' );
    	} else {
    		wp_cache_debug( "wp_cache_post_id_gc clearing cached index files in $dir.", 4 );
    		prune_super_cache( $dir, true, true );
    		do_action( 'gc_cache', 'prune', $permalink );
    	}
    	return true;
    }
    
    function wp_cache_post_change( $post_id ) {
    	global $file_prefix, $cache_path, $blog_id, $super_cache_enabled, $blog_cache_dir, $wp_cache_refresh_single_only;
    
  • /wp-cache-phase2.php line 3222
    	}
    	if ( $all == true ) {
    		wp_cache_debug( 'Post change: supercache enabled: deleting cache files in ' . $dir );
    		wpsc_rebuild_files( $dir );
    		do_action( 'gc_cache', 'prune', 'homepage' );
    		if ( get_option( 'show_on_front' ) == 'page' ) {
    			wp_cache_debug( 'Post change: deleting page_on_front and page_for_posts pages.', 4 );
    			wp_cache_debug( 'Post change: page_on_front ' . get_option( 'page_on_front' ), 4 );
    			/**
    			 * It's possible that page_for_posts is zero.
    			 * Quick fix to reduce issues in debugging.
    
  • /wp-cache-phase2.php line 3235
    			if ( get_option( 'page_for_posts' ) ) {
    				$permalink = trailingslashit( str_replace( get_option( 'home' ), '', get_permalink( get_option( 'page_for_posts' ) ) ) );
    				wp_cache_debug( 'Post change: Deleting files in: ' . str_replace( '//', '/', $dir . $permalink ) );
    				wpsc_rebuild_files( $dir . $permalink );
    				do_action( 'gc_cache', 'prune', $permalink );
    			}
    		}
    	} else {
    		wp_cache_debug( 'wp_cache_post_change: not deleting all pages.', 4 );
    	}
    
    
  • /wp-cache-phase2.php line 3271
    							if ( false == $supercache_files_deleted && $super_cache_enabled == true ) {
    								wp_cache_debug( "Post change: deleting supercache files for {$permalink}" );
    								wpsc_rebuild_files( $dir . $permalink );
    								$supercache_files_deleted = true;
    								do_action( 'gc_cache', 'rebuild', $permalink );
    							}
    						}
    					} elseif ( $meta['blog_id'] == $blog_id ) {
    						wp_cache_debug( "Post change: deleting wp-cache files for {$meta[ 'uri' ]}: $file", 4 );
    						@unlink( $blog_cache_dir . 'meta/' . $file );
    						@unlink( $blog_cache_dir . $file );
    
  • /wp-cache-phase2.php line 3281
    						@unlink( $blog_cache_dir . $file );
    						if ( $super_cache_enabled == true ) {
    							wp_cache_debug( "Post change: deleting supercache files for {$meta[ 'uri' ]}" );
    							wpsc_rebuild_files( $dir . $meta['uri'] );
    							do_action( 'gc_cache', 'rebuild', trailingslashit( $meta['uri'] ) );
    						}
    					}
    				}
    			}
    		}
    		closedir( $handle );
    

See this hook used in plugins: