the_category_ID()
Deprecated from version 0.7. It is no longer supported and can be removed in future releases. Use get_the_category() instead.
Returns or prints a category ID.
No Hooks.
Return
Int
. Category ID.
Usage
the_category_ID( $display );
- $display(true|false)
- Whether to display the output.
Default: true
Notes
- See: get_the_category()
Changelog
Since 0.71 | Introduced. | |
Deprecated Since 0.71 | Use get_the_category() |
Code of the_category_ID() the category ID WP 6.0
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; }