Filter hook 'get_the_modified_time'

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

View Source

get_the_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 3046

Hook Parameters

Type Name Description
string|int|false $the_time The formatted time or false if no post is found.
string $format Format to use for retrieving the time the post was modified. Accepts 'G', 'U', or PHP date format.
WP_Post|null $post WP_Post object or null if no post is found.

Usage Examples

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

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

Source Code Context

wp-includes/general-template.php:3046 - How this hook is used in WordPress core
<?php
3041  	 * @param string|int|false $the_time The formatted time or false if no post is found.
3042  	 * @param string           $format   Format to use for retrieving the time the post
3043  	 *                                   was modified. Accepts 'G', 'U', or PHP date format.
3044  	 * @param WP_Post|null     $post     WP_Post object or null if no post is found.
3045  	 */
3046  	return apply_filters( 'get_the_modified_time', $the_time, $format, $post );
3047  }
3048  
3049  /**
3050   * Retrieves the time at which the post was last modified.
3051   *

PHP Documentation

<?php
/**
	 * Filters the localized time a post was last modified.
	 *
	 * @since 2.0.0
	 * @since 4.6.0 Added the `$post` parameter.
	 *
	 * @param string|int|false $the_time The formatted time or false if no post is found.
	 * @param string           $format   Format to use for retrieving the time the post
	 *                                   was modified. Accepts 'G', 'U', or PHP date format.
	 * @param WP_Post|null     $post     WP_Post object or null if no post is found.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/general-template.php
Related Hooks

Related hooks will be displayed here in future updates.