nonce_life хук-фильтрWP 2.5.0

Filters the lifespan of nonces in seconds.

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

add_filter( 'nonce_life', 'wp_kama_nonce_life_filter', 10, 2 );

/**
 * Function for `nonce_life` filter-hook.
 * 
 * @param int        $lifespan Lifespan of nonces in seconds.
 * @param string|int $action   The nonce action, or -1 if none was provided.
 *
 * @return int
 */
function wp_kama_nonce_life_filter( $lifespan, $action ){

	// filter...
	return $lifespan;
}
$lifespan(int)
Lifespan of nonces in seconds.
По умолчанию: 86,400 seconds, or one day
$action(строка|int)
The nonce action, or -1 if none was provided.

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

С версии 2.5.0 Введена.
С версии 6.1.0 Added $action argument to allow for more targeted filters.

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

wp_nonce_tick()
nonce_life
wp-includes/pluggable.php 2293
$nonce_life = apply_filters( 'nonce_life', DAY_IN_SECONDS, $action );

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

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