wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



get_the_id › WordPress Function

Depuis2.1.0
Dépréciéen/a
get_the_id ( Pas de paramètres )
Retourne:
  • (int|false) The ID of the current item in the WordPress Loop. False if $post is not set.
Défini(e) dans:
Codex:

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



Source

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