post_type_exists()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
post_type_exists( string $post_type ): bool
Описание
Дополнительные сведения об этой и подобных функциях темы см. в статье Conditional Tags в Theme Developer Handbook.
См. alsoget_post_type_object()
Оригинал (английский)
For more information on this and similar theme functions, check out the Conditional Tags article in the Theme Developer Handbook.
Параметры
$post_type
string
обязательный
Возвращаемое значение
bool
Исходный код
wp-includes/post.php:1584
function post_type_exists( $post_type ) {
return (bool) get_post_type_object( $post_type );
}
История изменений
| Версия | Описание |
|---|---|
| 3.0.0 | Introduced. |

