Make WordPress Core

Ticket #1836: template-functions-general.php.diff

File template-functions-general.php.diff, 1023 bytes (added by markjaquith, 19 years ago)
  • template-functions-general.php

     
    632632}
    633633
    634634
     635function the_modified_time($d = '') {
     636        echo apply_filters('the_modified_time', get_the_modified_time($d), $d);
     637}
     638
     639
     640function get_the_modified_time($d = '') {
     641        if ( '' == $d )
     642                $the_time = get_post_modified_time(get_settings('time_format'));
     643        else
     644                $the_time = get_post_modified_time($d);
     645        return apply_filters('get_the_modified_time', $the_time, $d);
     646}
     647
     648
     649function get_post_modified_time( $d = 'U', $gmt = false ) { // returns timestamp
     650        global $post;
     651
     652        if ( $gmt )
     653                $time = $post->post_modified_gmt;
     654        else
     655                $time = $post->post_modified;
     656        $time = mysql2date($d, $time);
     657
     658        return apply_filters('get_the_modified_time', $time, $d, $gmt);
     659}
     660
     661
    635662function the_weekday() {
    636663        global $weekday, $id, $post;
    637664        $the_weekday = $weekday[mysql2date('w', $post->post_date)];