post_password_required

Sponsored Link

投稿にパスワードを必要とし、正しいパスワードが提供されているかどうか。

Sponsored Link

Whether post requires password and correct password has been provided.

post_password_requiredのテンプレートタグ使用方法

<?php post_password_required( $post ); ?>

post_password_requiredのパラメーター

$post

(mixed) (Global $post variable)投稿ID(整数)または投稿オブジェクトのいずれかを取得します。デフォルトはなし。

(mixed) (Global $post variable) Either the post ID (integer) or the post object.
Default: None

返り値

(boolean) Falseの場合、パスワードは必要としない、あるいは、正しいパスワードのCookieが存在します。それ以外の場合はtrueを返します。

(boolean)
False if a password is not required or the correct password cookie is present, true otherwise.

変更ログ

Since: 2.7.0

ソースファイル

post_password_requiredは、wp-includes/post-template.php内に存在しています。

post_password_required is located in wp-includes/post-template.php.

Sponsored Link