WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 778 | * Filters the life span of the post password cookie. |
| 779 | * |
| 780 | * By default, the cookie expires 10 days from creation. To turn this |
| 781 | * into a session cookie, return 0. |
| 782 | * |
| 783 | * @since 3.7.0 |
| 784 | * |
| 785 | * @param int $expires The expiry time, as passed to setcookie(). |
| 786 | */ |
| 787 | $expire = apply_filters( 'post_password_expires', time() + 10 * DAY_IN_SECONDS ); |
| 788 | |
| 789 | if ( $redirect_to ) { |
| 790 | $secure = ( 'https' === parse_url( $redirect_to, PHP_URL_SCHEME ) ); |
| 791 | } else { |
| 792 | $secure = false; |
| 793 | } |
| 794 | |
| 795 | setcookie( 'wp-postpass_' . COOKIEHASH, $hasher->HashPassword( wp_unslash( $_POST['post_password'] ) ), $expire, COOKIEPATH, COOKIE_DOMAIN, $secure ); |
| 796 | |