get_the_ID()

Retrieve the ID of the current item in the ClassicPress Loop.


Return

(int|false) The ID of the current item in the ClassicPress Loop. False if $post is not set.


Source

File: wp-includes/post-template.php

function get_the_ID() {
	$post = get_post();
	return ! empty( $post ) ? $post->ID : false;
}


Changelog

Changelog
Version Description
WP-2.1.0 Introduced.