WordPress at a glance

the_modified_date() WP 1.0

Display the date on which the post was last modified.

Works based on: get_the_modified_date()
✈ 1 time = 0.000555s = slow | 50000 times = 1.86s = fast PHP 7.1.2, WP 4.7.3
Hooks from function:
Return

String/null. String if retrieving.

Usage

the_modified_date( $d, $before, $after, $echo );
$d(string)
PHP date format defaults to the date_format option if not specified.
Default: ''
$before(string)
Output before the date.
Default: ''
$after(string)
Output after the date.
Default: ''
$echo(true/false)
Whether to echo the date or return it.
Default: display

Code of the_modified_date: wp-includes/general-template.php VER 4.9.8

<?php
function the_modified_date( $d = '', $before = '', $after = '', $echo = true ) {
	$the_modified_date = $before . get_the_modified_date($d) . $after;

	/**
	 * Filters the date a post was last modified for display.
	 *
	 * @since 2.1.0
	 *
	 * @param string $the_modified_date The last modified date.
	 * @param string $d                 PHP date format. Defaults to 'date_format' option
	 *                                  if not specified.
	 * @param string $before            HTML output before the date.
	 * @param string $after             HTML output after the date.
	 */
	$the_modified_date = apply_filters( 'the_modified_date', $the_modified_date, $d, $before, $after );

	if ( $echo )
		echo $the_modified_date;
	else
		return $the_modified_date;

}

Related Functions

From tag: modified (author date time)

More from category: Posts, pages...

More from Template Tags: Posts, Pages, ...

No comments
    Hello, !     Log In . Register