Codex

Function Reference/get post status

Contents

Description

Retrieve 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.

Usage

<?php get_post_status$ID ?>

Parameters

$ID
(integer) (optional) Post ID. This function will will return false if $ID is not provided.
Default: ''

Return Values

(string|boolean) 
Post status or false on failure.

Examples

Notes

Change Log

Since: 2.0.0

Source File

get_post_status() is located in wp-includes/post.php.

Related

See also index of Function Reference and index of Template Tags.