the_category_ID()
Устарела с версии 0.7. Больше не поддерживается и может быть удалена. Используйте get_the_category().
Returns or prints a category ID.
Хуков нет.
Возвращает
int. Category ID.
Использование
the_category_ID( $display );
- $display(true|false)
- Whether to display the output.
По умолчанию: true
Заметки
- Смотрите: get_the_category()
Список изменений
| С версии 0.71 | Введена. |
| Устарела с 0.71 | Use get_the_category() |
Код the_category_ID() the category ID WP 6.8.3
function the_category_ID($display = true) {
_deprecated_function( __FUNCTION__, '0.71', 'get_the_category()' );
// Grab the first cat in the list.
$categories = get_the_category();
$cat = $categories[0]->term_id;
if ( $display )
echo $cat;
return $cat;
}