Definition:
function post_password_required( $post = null ) {}
Whether post requires password and correct password has been provided.
Parameters
- int|object $post: An optional post. Global $post used if not provided.
Return values
returns:false if a password is not required or the correct password cookie is present, true otherwise.
Source code
function post_password_required( $post = null ) { $post = get_post($post); if ( empty($post->post_password) ) return false; if ( !isset($_COOKIE['wp-postpass_' . COOKIEHASH]) ) return true; if ( stripslashes( $_COOKIE['wp-postpass_' . COOKIEHASH] ) != $post->post_password ) return true; return false; }
2573
No comments yet... Be the first to leave a reply!