Determines whether a post type is considered "viewable". For built-in post types such as posts and pages, the 'public' value will be evaluated. For all others, the 'publicly_queryable' value will be used.
$post_type
Sortie :
@param string|WP_Post_Type $post_type Post type name or object. @return bool Whether the post type should be considered viewable.
// Utilisation de la fonction is_post_type_viewable
$result = is_post_type_viewable($post_type);
if ($result) {
// Votre logique ici
}
Chargement des actualités...