get_page_statuses() WordPress Function

The get_page_statuses() function is a powerful tool that allows you to get the status of any page on your WordPress site. This function is especially useful for troubleshooting purposes, as it can help you identify pages that are not loading correctly or that are returning 404 errors.

get_page_statuses() #

Retrieve all of the WordPress support page statuses.


Description

Pages have a limited set of valid status values, this provides the post_status values and descriptions.


Top ↑

Return

(string[]) Array of page status labels keyed by their status.


Top ↑

Source

File: wp-includes/post.php

function get_page_statuses() {
	$status = array(
		'draft'   => __( 'Draft' ),
		'private' => __( 'Private' ),
		'publish' => __( 'Published' ),
	);

	return $status;
}


Top ↑

Changelog

Changelog
VersionDescription
2.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More