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



get_the_id › WordPress Function

Desde2.1.0
Obsoleton/a
get_the_id ( Sem parâmetros )
Retorna:
  • (int|false) The ID of the current item in the WordPress Loop. False if $post is not set.
Definido em:
Codex:

Retrieves the ID of the current item in the WordPress Loop.



Fonte

function get_the_ID() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
	$post = get_post();
	return ! empty( $post ) ? $post->ID : false;
}