expiration_of_site_transient_(transient) filter-hookWP 4.4.0

Filters the expiration for a site transient before its value is set.

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

Usage

add_filter( 'expiration_of_site_transient_(transient)', 'wp_kama_expiration_of_site_transient_filter', 10, 3 );

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

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

Changelog

Since 4.4.0 Introduced.

Where the hook is called

set_site_transient()
expiration_of_site_transient_(transient)
wp-includes/option.php 2007
$expiration = apply_filters( "expiration_of_site_transient_{$transient}", $expiration, $value, $transient );

Where the hook is used in WordPress

Usage not found.