the_ID() WordPress Function

The the_ID() function is used to display the post or page ID. This function can be used within the loop.

the_ID() #

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


Source

File: wp-includes/post-template.php

function the_ID() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
	echo get_the_ID();
}


Top ↑

Changelog

Changelog
VersionDescription
0.71Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.