the_modified_time
Filter HookDescription
Filters the localized time a post was last modified, for display.Hook Information
File Location |
wp-includes/general-template.php
View on GitHub
|
Hook Type | Filter |
Line Number | 3008 |
Hook Parameters
Type | Name | Description |
---|---|---|
string|false
|
$get_the_modified_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. |
Usage Examples
Basic Usage
<?php
// Hook into the_modified_time
add_filter('the_modified_time', 'my_custom_filter', 10, 2);
function my_custom_filter($get_the_modified_time, $format) {
// Your custom filtering logic here
return $get_the_modified_time;
}
Source Code Context
wp-includes/general-template.php:3008
- How this hook is used in WordPress core
<?php
3003 *
3004 * @param string|false $get_the_modified_time The formatted time or false if no post is found.
3005 * @param string $format Format to use for retrieving the time the post
3006 * was modified. Accepts 'G', 'U', or PHP date format.
3007 */
3008 echo apply_filters( 'the_modified_time', get_the_modified_time( $format ), $format );
3009 }
3010
3011 /**
3012 * Retrieves the time at which the post was last modified.
3013 *
PHP Documentation
<?php
/**
* Filters the localized time a post was last modified, for display.
*
* @since 2.0.0
*
* @param string|false $get_the_modified_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.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-includes/general-template.php
Related Hooks
Related hooks will be displayed here in future updates.