wp-includes/general-template.php:3283Retrieves the time at which the post was last modified.
$formatstringoptional'U'$gmtbooloptionalfalse$postint|WP_Post|nulloptionalnull$translatebooloptionalfalsestring|int|falseOne hook fires while get_post_modified_time() runs, in this order:
Filters the localized time a post was last modified.
function get_post_modified_time( $format = 'U', $gmt = false, $post = null, $translate = false ) { $post = get_post( $post ); if ( ! $post ) { return false; } $source = ( $gmt ) ? 'gmt' : 'local'; $datetime = get_post_datetime( $post, 'modified', $source ); if ( false === $datetime ) { return false; } if ( 'U' === $format || 'G' === $format ) { $time = $datetime->getTimestamp(); // Returns a sum of timestamp with timezone offset. Ideally should never be used. if ( ! $gmt ) { $time += $datetime->getOffset(); } } elseif ( $translate ) { $time = wp_date( $format, $datetime->getTimestamp(), $gmt ? new DateTimeZone( 'UTC' ) : null ); } else { if ( $gmt ) { $datetime = $datetime->setTimezone( new DateTimeZone( 'UTC' ) ); } $time = $datetime->format( $format ); } /** * Filters the localized time a post was last modified. * * @since 2.8.0 * * @param string|int $time Formatted date string or Unix timestamp if `$format` is 'U' or 'G'. * @param string $format Format to use for retrieving the time the post was modified. * Accepts 'G', 'U', or PHP date format. Default 'U'. * @param bool $gmt Whether to retrieve the GMT time. Default false. */ return apply_filters( 'get_post_modified_time', $time, $format, $gmt );}Introduced in 2.0.0. One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
$post retyped from int|WP_Post to int|WP_Post|null.verified against sourcesrc/wp-includes/general-template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.