the_post_password()WP 2.7.0

Displays the post password.

The password is passed through esc_attr() to ensure that it is safe for placing in an HTML attribute.

Хуков нет.

Возвращает

null. Ничего (null).

Использование

the_post_password();

Список изменений

С версии 2.7.0 Введена.

Код the_post_password() WP 6.5.2

function the_post_password() {
	$post = get_post();
	if ( isset( $post->post_password ) ) {
		echo esc_attr( $post->post_password );
	}
}