get_the_date

SummerySummery

Retrieve the date on which the post was written.

Syntax

get_the_date( string $format = '', int|WP_Post $post = null )

DescriptionDescription

Unlike the_date() this function will always return the date. Modify output with the ‘get_the_date’ filter.

ParametersParameters

$format

(string) (Optional) PHP date format defaults to the date_format option if not specified.

Default value: ''

$post

(int|WP_Post) (Optional) Post ID or WP_Post object. Default current post.

Default value: null

ReturnReturn

(string|false) Date the current post was written. False on failure.

SourceSource

File: wp-includes/general-template.php


			

ChangelogChangelog

Changelog
Version Description
3.0.0 Introduced.
Scroll to Top