post_password_expires
Filters the life span of the post password cookie.
By default, the cookie expires 10 days from creation. To turn this into a session cookie, return 0.
Использование
add_filter( 'post_password_expires', 'wp_kama_post_password_expires_filter' ); /** * Function for `post_password_expires` filter-hook. * * @param int $expires The expiry time, as passed to setcookie(). * * @return int */ function wp_kama_post_password_expires_filter( $expires ){ // filter... return $expires; }
- $expires(int)
- The expiry time, as passed to setcookie().
Список изменений
С версии 3.7.0 | Введена. |
Где вызывается хук
В файле: /wp-login.php
post_password_expires
wp-login.php 778
$expire = apply_filters( 'post_password_expires', time() + 10 * DAY_IN_SECONDS );