Summery Summery

Retrieve the date on which the post was written.

Syntax Syntax

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

Description Description

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

Parameters Parameters


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

Default value: ''


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

Default value: null

Return Return

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

Source Source

File: wp-includes/general-template.php

		 * Filters the HTML calendar output.
		 * @since 3.0.0
		 * @param string $calendar_output HTML output of the calendar.
		echo apply_filters( 'get_calendar', $calendar_output );
	/** This filter is documented in wp-includes/general-template.php */
	return apply_filters( 'get_calendar', $calendar_output );

 * Purge the cached results of get_calendar.
 * @see get_calendar
 * @since 2.1.0
function delete_get_calendar_cache() {
	wp_cache_delete( 'get_calendar', 'calendar' );

 * Display all of the allowed tags in HTML format with attributes.


Changelog Changelog

Version Description
3.0.0 Introduced.


Leave a Reply