WordPress开发者和主题制作者的搜索引擎



wp_nonce_tick ›

Since2.5.0
已弃用n/a
wp_nonce_tick ( 没有参数 )
返回:
  • (float) Float value rounded up to the next highest integer.
定义在:
文档:

Get the time-dependent variable for nonce creation.

A nonce has a lifespan of two ticks. Nonces in their second tick may be updated, e.g. by autosave.



源码

function wp_nonce_tick() {
		/**
		 * Filters the lifespan of nonces in seconds.
		 *
		 * @since 2.5.0
		 *
		 * @param int $lifespan Lifespan of nonces in seconds. Default 86,400 seconds, or one day.
		 */
		$nonce_life = apply_filters( 'nonce_life', DAY_IN_SECONDS );

		return ceil( time() / ( $nonce_life / 2 ) );
	}
endif;

if ( ! function_exists( 'wp_verify_nonce' ) ) :