the_post_password() WordPress Function
The the_post_password() function is used to display the password form for a post. This function must be used within The Loop.
the_post_password() #
Displays the post password.
Description
The password is passed through esc_attr() to ensure that it is safe for placing in an HTML attribute.
Source
File: wp-admin/includes/template.php
function the_post_password() { $post = get_post(); if ( isset( $post->post_password ) ) { echo esc_attr( $post->post_password ); } }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.7.0 | Introduced. |