is_post_publicly_viewable
is_post_publicly_viewable ( $post = null )
Parameters:- (int|WP_Post|null) post Optional. Post ID or post object. Defaults to global $post.
Returns:- (bool) Whether the post is publicly viewable.
Defined at: - Introduced in WordPress: 5.7.0
- Deprecated in WordPress: —
Description
Determines whether a post is publicly viewable.Posts are considered publicly viewable if both the post status and post type
are viewable.