How to check if page has status published

How to check if page id(SomeID) is actually published?

3 s
3

You can use 'publish' === get_post_status( $id ), where $id could be the current page ID retrieved via get_the_ID() or any other.

Leave a Comment