the_post_password()
Displays the post password.
The password is passed through esc_attr() to ensure that it is safe for placing in an HTML attribute.
No Hooks.
Returns
null. Nothing (null).
Usage
the_post_password();
Changelog
| Since 2.7.0 | Introduced. |
the_post_password() the post password code WP 7.0
function the_post_password() {
$post = get_post();
if ( isset( $post->post_password ) ) {
echo esc_attr( $post->post_password );
}
}