invp_get_the_last_modified( int|null $post_ID = null )
Template tag. Returns the timestamp the vehicle was last modified formatted as a string according to WordPress’ date and time format as set at Settings → General.
On This Page
Parameters Parameters
- $post_ID
-
(int|null) (Optional) The post ID of a vehicle. Must be passed when using this method outside the loop.
Default value: null
Return Return
(string)
Source Source
File: includes/template-tags.php
function invp_get_the_last_modified( $post_ID = null ) {
$date_format = get_option( 'date_format' );
$time_format = get_option( 'time_format' );
// Mon, 25 Apr 2022 01:45:46 -0400.
$date = DateTime::createFromFormat( 'D, d M Y h:i:s O', invp_get_raw_last_modified( $post_ID ) );
if ( ! $date ) {
return '';
}
return gmdate( $date_format . ' ' . $time_format, $date->getTimestamp() );
}
Expand full source codeCollapse full source codeView on Github