Answers for "wordpress check if page is password protected"

PHP
0

wordpress check if page is password protected

//post id is optional
if(post_password_required($post_id)) {}
//or
if(!empty($post->post_password)){
   // do some stuff
}
Posted by: Guest on December-10-2020

Code answers related to "wordpress check if page is password protected"

Browse Popular Code Answers by Language