Conditional to test if post has password protection enabled

You could use

if(!empty($post->post_password)){
   // do some stuff
}

which is what the post_password_required() code does before checking the user’s credentials against the password itself.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)