From 0b517ae013cf1c0bd62b0a6941eba41fda63a59f Mon Sep 17 00:00:00 2001 From: westi Date: Wed, 23 Dec 2009 15:22:08 +0000 Subject: [PATCH] Extend the_modified_date() to support before/after/echo. Fixes #11255 props ShaneF. git-svn-id: http://svn.automattic.com/wordpress/trunk@12514 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/general-template.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index abb223a0a..a214d6a5e 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -1245,11 +1245,22 @@ function the_date($d='', $before='', $after='', $echo = true) { * * @since 2.1.0 * - * @param string $d Optional. PHP date format. - * @return string + * @param string $d Optional. PHP date format defaults to the date_format option if not specified. + * @param string $before Optional. Output before the date. + * @param string $after Optional. Output after the date. + * @param bool $echo Optional, default is display. Whether to echo the date or return it. + * @return string|null Null if displaying, string if retrieving. */ -function the_modified_date($d = '') { - echo apply_filters('the_modified_date', get_the_modified_date($d), $d); +function the_modified_date($d = '', $before='', $after='', $echo = true) { + + $the_modified_date = $before . get_the_modified_date($d) . $after; + $the_modified_date = apply_filters('the_modified_date', $the_modified_date, $d, $before, $after); + + if ( $echo ) + echo $the_modified_date; + else + return $the_modified_date; + } /**