get_the_ID()
Retrieve the ID of the current item in the WordPress Loop.
Return Return
(int|false) The ID of the current item in the WordPress Loop. False if $post is not set.
Source Source
File: wp-includes/post-template.php
|
27 28 29 30 |
function get_the_ID() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid $post = get_post(); return ! empty( $post ) ? $post->ID : false;} |
View on Trac
Changelog Changelog
| Version | Description |
|---|---|
| 2.1.0 | Introduced. |
