wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



get_the_id › WordPress Function

Od2.1.0
Przestarzałyn/a
get_the_id ( Brak parametrów )
Powrót:
  • (int|false) The ID of the current item in the WordPress Loop. False if $post is not set.
Zdefiniowane na:
Codex:

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



Źródło

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