Is there a theme function for is_password_protected()?

I’m looking at the function and template references and I’m not seeing a way to test for whether a post is protected. Is there a theme function for (something like) is_password_protected()?

I’m already using add_filter( 'the_password_form', 'custom_password_form' ); to override the default form that shows up, but I want to customize some other aspects of the look when a post is password protected.

2 Answers
2

Yes there is. It’s post_password_required:

Whether post requires password and
correct password has been provided.

Leave a Comment