Filter hook 'get_post_modified_time'

in WP Core File wp-includes/general-template.php at line 3103

View Source

get_post_modified_time

Filter Hook
Description
Filters the localized time a post was last modified.

Hook Information

File Location wp-includes/general-template.php View on GitHub
Hook Type Filter
Line Number 3103

Hook Parameters

Type Name Description
string|int $time Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
string $format Format to use for retrieving the time the post was modified. Accepts 'G', 'U', or PHP date format. Default 'U'.
bool $gmt Whether to retrieve the GMT time. Default false.

Usage Examples

Basic Usage
<?php
// Hook into get_post_modified_time
add_filter('get_post_modified_time', 'my_custom_filter', 10, 3);

function my_custom_filter($time, $format, $gmt) {
    // Your custom filtering logic here
    return $time;
}

Source Code Context

wp-includes/general-template.php:3103 - How this hook is used in WordPress core
<?php
3098  	 * @param string|int $time   Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
3099  	 * @param string     $format Format to use for retrieving the time the post was modified.
3100  	 *                           Accepts 'G', 'U', or PHP date format. Default 'U'.
3101  	 * @param bool       $gmt    Whether to retrieve the GMT time. Default false.
3102  	 */
3103  	return apply_filters( 'get_post_modified_time', $time, $format, $gmt );
3104  }
3105  
3106  /**
3107   * Displays the localized weekday for the post.
3108   *

PHP Documentation

<?php
/**
	 * 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.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/general-template.php
Related Hooks

Related hooks will be displayed here in future updates.