Senha necessária WP

//post id is optional
if(post_password_required($post_id)) {}
//or
if(!empty($post->post_password)){
   // do some stuff
}
Andrew Lautenbach