# get_post_type_object()

URL: https://chugunov.pro/api-wordpress/functions/get_post_type_object/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 3.0.0.

## Сигнатура

```php
get_post_type_object( string $post_type ): WP_Post_Type|null
```

## Описание

См. alsoregister_post_type()

## Параметры

- `$post_type` `string` — обязательный. Имя зарегистрированного типа записи.

## Возвращаемое значение

`WP_Post_Type|null` — WP_Post_Type

## Исходный код

Файл: `wp-includes/post.php:1618`

```php
function get_post_type_object( $post_type ) {
	global $wp_post_types;

	if ( ! is_scalar( $post_type ) || empty( $wp_post_types[ $post_type ] ) ) {
		return null;
	}

	return $wp_post_types[ $post_type ];
}
```

## История изменений

- 4.6.0 — Object returned is now an instance of WP_Post_Type.
- 3.0.0 — Introduced.

## Связанные

Используется в: `WP_HTTP_Polling_Sync_Server::can_user_sync_entity_type`, [`is_post_embeddable`](https://chugunov.pro/api-wordpress/functions/is_post_embeddable/), `WP_REST_Font_Faces_Controller::get_items_permissions_check`, `WP_REST_Font_Families_Controller::get_items_permissions_check`, `WP_REST_Template_Autosaves_Controller::__construct`, `WP_REST_Template_Revisions_Controller::__construct`, `WP_REST_Navigation_Fallback_Controller::get_item_permissions_check`, `WP_REST_Global_Styles_Revisions_Controller::__construct`, [`_wp_build_title_and_description_for_single_post_type_block_template`](https://chugunov.pro/api-wordpress/functions/_wp_build_title_and_description_for_single_post_type_block_template/), `WP_REST_Menu_Items_Controller::prepare_item_for_database`, `WP_REST_Global_Styles_Controller::get_available_actions`, [`rest_get_route_for_post_type_items`](https://chugunov.pro/api-wordpress/functions/rest_get_route_for_post_type_items/), `WP_REST_Templates_Controller::get_available_actions`, `WP_REST_Templates_Controller::__construct`, [`wp_force_plain_post_permalink`](https://chugunov.pro/api-wordpress/functions/wp_force_plain_post_permalink/), `WP_REST_Autosaves_Controller::__construct`, [`use_block_editor_for_post_type`](https://chugunov.pro/api-wordpress/functions/use_block_editor_for_post_type/), [`register_and_do_post_meta_boxes`](https://chugunov.pro/api-wordpress/functions/register_and_do_post_meta_boxes/), `WP_REST_Posts_Controller::get_available_actions`, `WP_Customize_Manager::check_changeset_lock_with_heartbeat`, `WP_Customize_Manager::handle_override_changeset_lock_request`, `WP_Customize_Manager::handle_dismiss_autosave_or_lock_request`, `WP_Customize_Manager::handle_changeset_trash_request`, `WP_Customize_Manager::grant_edit_post_capability_for_changeset`, [`get_the_post_type_description`](https://chugunov.pro/api-wordpress/functions/get_the_post_type_description/), [`wp_load_press_this`](https://chugunov.pro/api-wordpress/functions/wp_load_press_this/), `WP_REST_Revisions_Controller::__construct`, `WP_REST_Posts_Controller::prepare_links`, `WP_REST_Posts_Controller::get_item_schema`, `WP_REST_Posts_Controller::get_collection_params`, `WP_REST_Posts_Controller::sanitize_post_statuses`, `WP_REST_Posts_Controller::check_is_post_type_allowed`, `WP_REST_Posts_Controller::check_read_permission`, `WP_REST_Posts_Controller::check_update_permission`, `WP_REST_Posts_Controller::check_create_permission`, `WP_REST_Posts_Controller::check_delete_permission`, `WP_REST_Posts_Controller::prepare_item_for_response`, `WP_REST_Posts_Controller::prepare_item_for_database`, `WP_REST_Posts_Controller::update_item_permissions_check`, `WP_REST_Posts_Controller::get_item`.

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/get_post_type_object/
