get_post_status

FUNCTION wp-includes\post.php (ligne 1240) github
Retrieves the post status based on the post ID. If the post ID is of an attachment, then the parent post status will be given instead.

Paramètres

Entrée :
$post = null
Sortie :
@param int|WP_Post $post Optional. Post ID or post object. Defaults to global $post.
@return string|false Post status on success, false on failure.

Utilisation

// Utilisation de la fonction get_post_status
$result = get_post_status($post = null);

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

Actualités

Chargement des actualités...