get_the_date

Definition:
function get_the_date( $d = '' ) {}

Retrieve the date the current $post was written.
Unlike the_date() this function will always return the date. Modify output with ‘get_the_date’ filter.

Parameters

  • string $d: Optional. PHP date format defaults to the date_format option if not specified.

Return values

returns:Null if displaying, string if retrieving.

Defined filters

  • get_the_date
    apply_filters('get_the_date', $the_date, $d)

Source code

function get_the_date( $d = '' ) {

	global $post;

	$the_date = '';



	if ( '' == $d )

		$the_date .= mysql2date(get_option('date_format'), $post->post_date);

	else

		$the_date .= mysql2date($d, $post->post_date);



	return apply_filters('get_the_date', $the_date, $d);

}

1827

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: