is_post_type_viewable

FUNCTION wp-includes\post.php (ligne 2399) github
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.

Paramètres

Entrée :
$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

// Utilisation de la fonction is_post_type_viewable
$result = is_post_type_viewable($post_type);

if ($result) {
    // Votre logique ici
}

Actualités

Chargement des actualités...