How do I check if a posts status is set to draft or pending?
I would like to check a posts status, in particular I want to know if a post is set to draft or is privately published. I have the following code: if (‘draft’ != get_post_status() || is_user_logged_in()) { $this->render(); } else { wp_redirect( site_url(‘404’) ); exit; } It checks to see if a posts status is … Read more