WordPress.org

Make WordPress Core

Ticket #11255: the_modified_date.diff

File the_modified_date.diff, 1.1 KB (added by ShaneF, 9 years ago)
  • general-template.php

     
    12451245 *
    12461246 * @since 2.1.0
    12471247 *
    1248  * @param string $d Optional. PHP date format.
    1249  * @return string
     1248 * @param string $d Optional. PHP date format defaults to the date_format option if not specified.
     1249 * @param string $before Optional. Output before the date.
     1250 * @param string $after Optional. Output after the date.
     1251 * @param bool $echo Optional, default is display. Whether to echo the date or return it.
     1252 * @return string|null Null if displaying, string if retrieving.
    12501253 */
    1251 function the_modified_date($d = '') {
    1252         echo apply_filters('the_modified_date', get_the_modified_date($d), $d);
     1254function the_modified_date($d = '', $before='', $after='', $echo = true) {
     1255       
     1256        $the_modified_date = $before . get_the_modified_date($d) . $after;
     1257        $the_modified_date = apply_filters('the_modified_date', $the_modified_date, $d, $before, $after);
     1258       
     1259        if ( $echo )
     1260                echo $the_modified_date;
     1261        else
     1262                return $the_modified_date;
     1263       
    12531264}
    12541265
    12551266/**