expiration_of_transient_(transient) хук-фильтрWP 4.4.0

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

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

Использование

add_filter( 'expiration_of_transient_(transient)', 'wp_kama_expiration_of_transient_filter', 10, 3 );

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

	// filter...
	return $expiration;
}
$expiration(int)
Time until expiration in seconds. Use 0 for no expiration.
$value(разное)
New value of transient.
$transient(строка)
Transient name.

Список изменений

С версии 4.4.0 Введена.

Где вызывается хук

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

Где используется хук в WordPress

Использование не найдено.