Filter hook 'the_time'

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

View Source

the_time

Filter Hook
Description
Filters the time of the post, for display.

Hook Information

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

Hook Parameters

Type Name Description
string $get_the_time The formatted time.
string $format Format to use for retrieving the time the post was written. Accepts 'G', 'U', or PHP date format.

Usage Examples

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

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

Source Code Context

wp-includes/general-template.php:2821 - How this hook is used in WordPress core
<?php
2816  	 *
2817  	 * @param string $get_the_time The formatted time.
2818  	 * @param string $format       Format to use for retrieving the time the post
2819  	 *                             was written. Accepts 'G', 'U', or PHP date format.
2820  	 */
2821  	echo apply_filters( 'the_time', get_the_time( $format ), $format );
2822  }
2823  
2824  /**
2825   * Retrieves the time of the post.
2826   *

PHP Documentation

<?php
/**
	 * Filters the time of the post, for display.
	 *
	 * @since 0.71
	 *
	 * @param string $get_the_time The formatted time.
	 * @param string $format       Format to use for retrieving the time the post
	 *                             was written. 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.