wpseek.com
A WordPress-centric search engine for devs and theme authors



the_modified_date › WordPress Function

Since2.1.0
Deprecatedn/a
the_modified_date ( $format = '', $before = '', $after = '', $display = true )
Parameters: (4)
  • (string) $format Optional. PHP date format. Defaults to the 'date_format' option.
    Required: No
    Default: (empty)
  • (string) $before Optional. Output before the date. Default empty.
    Required: No
    Default: (empty)
  • (string) $after Optional. Output after the date. Default empty.
    Required: No
    Default: (empty)
  • (bool) $display Optional. Whether to echo the date or return it. Default true.
    Required: No
    Default: true
Returns:
  • (string|void) String if retrieving.
Defined at:
Codex:

Displays the date on which the post was last modified.



Source

function the_modified_date( $format = '', $before = '', $after = '', $display = true ) {
	$the_modified_date = $before . get_the_modified_date( $format ) . $after;

	/**
	 * Filters the date a post was last modified for display.
	 *
	 * @since 2.1.0
	 *
	 * @param string|false $the_modified_date The last modified date or false if no post is found.
	 * @param string       $format            PHP date format.
	 * @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, $format, $before, $after );

	if ( $display ) {
		echo $the_modified_date;
	} else {
		return $the_modified_date;
	}
}