pre_set_transient_(transient) filter-hookWP 3.0.0

Filters a specific transient before its value is set.

The dynamic portion of the hook name, $transient, refers to the transient name.

Usage

add_filter( 'pre_set_transient_(transient)', 'wp_kama_pre_set_transient_filter', 10, 3 );

/**
 * Function for `pre_set_transient_(transient)` filter-hook.
 * 
 * @param mixed  $value      New value of transient.
 * @param int    $expiration Time until expiration in seconds.
 * @param string $transient  Transient name.
 *
 * @return mixed
 */
function wp_kama_pre_set_transient_filter( $value, $expiration, $transient ){

	// filter...
	return $value;
}
$value(mixed)
New value of transient.
$expiration(int)
Time until expiration in seconds.
$transient(string)
Transient name.

Changelog

Since 3.0.0 Introduced.
Since 4.2.0 The $expiration parameter was added.
Since 4.4.0 The $transient parameter was added.

Where the hook is called

set_transient()
pre_set_transient_(transient)
wp-includes/option.php 1289
$value = apply_filters( "pre_set_transient_{$transient}", $value, $expiration, $transient );

Where the hook is used in WordPress

Usage not found.