wpsc_wp_die_disable_cache()WPSCache 1.0

Disable caching for pages rendered via wp_die().

The function wp_die() is used to render error and interstitial pages (e.g. "Error establishing a database connection"); caching them causes the error to persist for subsequent visitors even after the underlying issue is resolved.

Hooks from the function

Returns

callable.

Usage

wpsc_wp_die_disable_cache( $handler );
$handler(callable) (required)
The registered wp_die handler, returned unchanged.

wpsc_wp_die_disable_cache() code WPSCache 3.1.1

function wpsc_wp_die_disable_cache( $handler ) {
	/**
	 * Filters whether to disable caching when wp_die() is invoked.
	 *
	 * @param bool $disable Whether to set DONOTCACHEPAGE. Default true.
	 */
	if ( apply_filters( 'wpsc_disable_cache_on_wp_die', true ) && ! defined( 'DONOTCACHEPAGE' ) ) {
		define( 'DONOTCACHEPAGE', true );
	}
	return $handler;
}