I’d like to hide the sidebar of my page when the page is password protected and the password has not yet been entered.
I’ve searched for a while and haven’t found any condition I could use. Maybe get_post_status
could help, but still, I wouldn’t know when the user has entered the password and can see the full page.
You’re after
post_password_required()
: