WordPress at a glance

get_post_status_object() WP 1.0

Retrieve a post status object by name.

Возвращает

Object/null. A post status object.

Использование

get_post_status_object( $post_status );
$post_status(string) (required)
The name of a registered post status.

Заметки

  • Global. Array. $wp_post_statuses List of post statuses.
  • See: register_post_status()

Changelog

Since 3.0.0 Introduced.

Код get_post_status_object() WP 5.5.1

<?php
function get_post_status_object( $post_status ) {
	global $wp_post_statuses;

	if ( empty( $wp_post_statuses[ $post_status ] ) ) {
		return null;
	}

	return $wp_post_statuses[ $post_status ];
}

From tag: statuses (of post comment user)

More from category: Other

No comments
    Log In . Register