Fix drafts module

git-svn-id: http://svn.automattic.com/wordpress/trunk@9476 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-11-02 21:05:38 +00:00
parent 3368e6b8e5
commit 63f6b5312b
2 changed files with 13 additions and 8 deletions

View File

@ -359,10 +359,10 @@ function wp_dashboard_recent_drafts( $drafts = false ) {
if ( $drafts && is_array( $drafts ) ) {
$list = array();
foreach ( $drafts as $post ) {
foreach ( $drafts as $draft ) {
$url = get_edit_post_link( $draft->ID );
$title = _draft_or_post_title( $draft->ID );
$list[] = '<abbr title="' . get_the_time(__('Y/m/d g:i:s A')) . '">' . get_the_time( get_option( 'date_format' ) ) . "</abbr> <a href='$url' title='" . sprintf( __( 'Edit "%s"' ), attribute_escape( $title ) ) . "'>$title</a>";
$list[] = '<abbr title="' . get_the_time(__('Y/m/d g:i:s A'), $draft) . '">' . get_the_time( get_option( 'date_format' ), $draft ) . "</abbr> <a href='$url' title='" . sprintf( __( 'Edit "%s"' ), attribute_escape( $title ) ) . "'>$title</a>";
}
?>
<ul>

View File

@ -1222,14 +1222,17 @@ function the_time( $d = '' ) {
* @since 1.5.0
*
* @param string $d Either 'G', 'U', or php date format defaults to the value specified in the time_format option.
* @param int|object $post Optional post ID or object. Default is global $post object.
* @return string
*/
function get_the_time( $d = '' ) {
function get_the_time( $d = '', $post = null ) {
$post = get_post($post);
if ( '' == $d )
$the_time = get_post_time(get_option('time_format'));
$the_time = get_post_time(get_option('time_format'), false, $post);
else
$the_time = get_post_time($d);
return apply_filters('get_the_time', $the_time, $d);
$the_time = get_post_time($d, false, $post);
return apply_filters('get_the_time', $the_time, $d, $post);
}
/**
@ -1239,10 +1242,12 @@ function get_the_time( $d = '' ) {
*
* @param string $d Either 'G', 'U', or php date format.
* @param bool $gmt Whether of not to return the gmt time.
* @param int|object $post Optional post ID or object. Default is global $post object.
* @return string
*/
function get_post_time( $d = 'U', $gmt = false ) { // returns timestamp
global $post;
function get_post_time( $d = 'U', $gmt = false, $post ) { // returns timestamp
$post = get_post($post);
if ( $gmt )
$time = $post->post_date_gmt;
else