WordPress filter hook · part of WordPress core

get_the_time

A WordPress core filter that 7 plugins also fire themselves, running on 690+ sites between them.

How to use get_the_time

It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'get_the_time', function( $the_time, $tf ) {
	// Change $the_time here.
	return $the_time;
}, 10, 2 );

Argument names come from Live Editor's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

7 plugins that fire get_the_time

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Customizable Post Listings icon Customizable Post Listings600+ installs apply_filters( 'get_the_time', get_post_time($time_format) ) customizable-post-listings.php:449
  2. Super Related Posts icon Super Related Posts50+ installs apply_filters( 'get_the_time', $d, $fmt ) includes/output_tags.php:1029
  3. Live Editor icon Live Editor20+ installs apply_filters( 'get_the_time', $the_time, $tf ) LolitaFramework/Core/Decorators/Comment.php:427
  4. Shortcode Mastery icon Shortcode Mastery10+ installs apply_filters( 'get_the_time', $the_time, $tf ) classes/twig/class.shortcode-mastery-twig-post.php:457
  5. Data Generator icon Data Generator10+ installs apply_filters( 'get_the_time', $the_time, $tf ) LolitaFramework/Core/Decorators/Post.php:502
  6. Placeholder images icon Placeholder imagesFewer than 10 installs apply_filters( 'get_the_time', $the_time, $tf ) LolitaFramework/Core/Decorators/Comment.php:427
  7. Recent Posts Multi-sitewide icon Recent Posts Multi-sitewideFewer than 10 installs apply_filters( 'get_the_time', $the_time, $d, $post ) recent_mu_posts.php:132

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.