wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



the_category_id › WordPress Function

Desde0.71
Obsoleto0.71.0
the_category_id ( $display = true )
Parâmetros:
  • (bool) $display Optional. Whether to display the output. Default true.
    Required: No
    Padrão: true
Ver:
Retorna:
  • (int) Category ID.
Definido em:
Codex:

Returns or prints a category ID.



Fonte

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;
}