the_modified_date

Display the date on which the post was last modified.

Description

(string|void) the_modified_date( (string) $d = '', (string) $before = '', (string) $after = '', (bool) $echo = true ); 

Returns (string|void)

String if retrieving.

Parameters (4)

0. $d — Optional. (string) => ''
PHP date format defaults to the date_format option if not specified.
1. $before — Optional. (string) => ''
Output before the date.
2. $after — Optional. (string) => ''
Output after the date.
3. $echo — Optional. (bool) => true
Optional, default is display. Whether to echo the date or return it.

Usage

  1. if ( !function_exists( 'the_modified_date' ) ) { 
  2. require_once ABSPATH . WPINC . '/general-template.php'; 
  3.  
  4. // Optional. PHP date format defaults to the date_format option if not specified. 
  5. $d = ''; 
  6.  
  7. // Optional. Output before the date. 
  8. $before = ''; 
  9.  
  10. // Optional. Output after the date. 
  11. $after = ''; 
  12.  
  13. // Optional, default is display. Whether to echo the date or return it. 
  14. $echo = true; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = the_modified_date($d, $before, $after, $echo); 
  18.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/general-template.php  
  1. function the_modified_date( $d = '', $before = '', $after = '', $echo = true ) { 
  2. $the_modified_date = $before . get_the_modified_date($d) . $after; 
  3.  
  4. /** 
  5. * Filters the date a post was last modified for display. 
  6. * @since 2.1.0 
  7. * @param string $the_modified_date The last modified date. 
  8. * @param string $d PHP date format. Defaults to 'date_format' option 
  9. * if not specified. 
  10. * @param string $before HTML output before the date. 
  11. * @param string $after HTML output after the date. 
  12. */ 
  13. $the_modified_date = apply_filters( 'the_modified_date', $the_modified_date, $d, $before, $after ); 
  14.  
  15. if ( $echo ) 
  16. echo $the_modified_date; 
  17. else 
  18. return $the_modified_date; 
  19.