Fix drafts module
git-svn-id: https://develop.svn.wordpress.org/trunk@9476 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
fa7377cd36
commit
c9718cf8e2
@ -359,10 +359,10 @@ function wp_dashboard_recent_drafts( $drafts = false ) {
|
|||||||
|
|
||||||
if ( $drafts && is_array( $drafts ) ) {
|
if ( $drafts && is_array( $drafts ) ) {
|
||||||
$list = array();
|
$list = array();
|
||||||
foreach ( $drafts as $post ) {
|
foreach ( $drafts as $draft ) {
|
||||||
$url = get_edit_post_link( $draft->ID );
|
$url = get_edit_post_link( $draft->ID );
|
||||||
$title = _draft_or_post_title( $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>
|
<ul>
|
||||||
|
@ -1222,14 +1222,17 @@ function the_time( $d = '' ) {
|
|||||||
* @since 1.5.0
|
* @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 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
|
* @return string
|
||||||
*/
|
*/
|
||||||
function get_the_time( $d = '' ) {
|
function get_the_time( $d = '', $post = null ) {
|
||||||
|
$post = get_post($post);
|
||||||
|
|
||||||
if ( '' == $d )
|
if ( '' == $d )
|
||||||
$the_time = get_post_time(get_option('time_format'));
|
$the_time = get_post_time(get_option('time_format'), false, $post);
|
||||||
else
|
else
|
||||||
$the_time = get_post_time($d);
|
$the_time = get_post_time($d, false, $post);
|
||||||
return apply_filters('get_the_time', $the_time, $d);
|
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 string $d Either 'G', 'U', or php date format.
|
||||||
* @param bool $gmt Whether of not to return the gmt time.
|
* @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
|
* @return string
|
||||||
*/
|
*/
|
||||||
function get_post_time( $d = 'U', $gmt = false ) { // returns timestamp
|
function get_post_time( $d = 'U', $gmt = false, $post ) { // returns timestamp
|
||||||
global $post;
|
$post = get_post($post);
|
||||||
|
|
||||||
if ( $gmt )
|
if ( $gmt )
|
||||||
$time = $post->post_date_gmt;
|
$time = $post->post_date_gmt;
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user