From 833f1cca4eb88f9dea3e4e9008d65a69ee8756ea Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 10 Nov 2005 23:31:30 +0000 Subject: [PATCH] Template functions for getting the post's modified time from error and Mark Jaquith. fixes #1836 git-svn-id: http://svn.automattic.com/wordpress/trunk@3030 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/template-functions-general.php | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/wp-includes/template-functions-general.php b/wp-includes/template-functions-general.php index c16fa057d..1dea56f14 100644 --- a/wp-includes/template-functions-general.php +++ b/wp-includes/template-functions-general.php @@ -632,6 +632,33 @@ function get_post_time( $d = 'U', $gmt = false ) { // returns timestamp } +function the_modified_time($d = '') { + echo apply_filters('the_modified_time', get_the_modified_time($d), $d); +} + + +function get_the_modified_time($d = '') { + if ( '' == $d ) + $the_time = get_post_modified_time(get_settings('time_format')); + else + $the_time = get_post_modified_time($d); + return apply_filters('get_the_modified_time', $the_time, $d); +} + + +function get_post_modified_time( $d = 'U', $gmt = false ) { // returns timestamp + global $post; + + if ( $gmt ) + $time = $post->post_modified_gmt; + else + $time = $post->post_modified; + $time = mysql2date($d, $time); + + return apply_filters('get_the_modified_time', $time, $d, $gmt); +} + + function the_weekday() { global $weekday, $id, $post; $the_weekday = $weekday[mysql2date('w', $post->post_date)];