Fix display of dates for drafts and future posts. Props DD32 and ffemtcj. see #5774
git-svn-id: https://develop.svn.wordpress.org/trunk@6768 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3c1a115108
commit
5deeece50b
|
@ -128,14 +128,19 @@ addLoadEvent(focusit);
|
||||||
<?php
|
<?php
|
||||||
if ($post_ID):
|
if ($post_ID):
|
||||||
|
|
||||||
if ( 'future' == $post->post_status )
|
if ( 'future' == $post->post_status ) {
|
||||||
$time = __('Scheduled for:<br />%1$s at %2$s');
|
$time = __('Scheduled for:<br />%1$s at %2$s');
|
||||||
else if ( 'publish' == $post->post_status )
|
$date = $post->post_date;
|
||||||
|
} else if ( 'publish' == $post->post_status ) {
|
||||||
$time = __('Published on:<br />%1$s at %2$s');
|
$time = __('Published on:<br />%1$s at %2$s');
|
||||||
else
|
$date = $post->post_date;
|
||||||
|
} else {
|
||||||
$time = __('Saved on:<br />%1$s at %2$s');
|
$time = __('Saved on:<br />%1$s at %2$s');
|
||||||
|
$date = $post->post_modified;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<p><?php printf($time, mysql2date(get_option('date_format'), $post->post_date), mysql2date(get_option('time_format'), $post->post_date)); ?>
|
<p><?php printf($time, mysql2date(get_option('date_format'), $date), mysql2date(get_option('time_format'), $date)); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -93,14 +93,19 @@ addLoadEvent(focusit);
|
||||||
<?php
|
<?php
|
||||||
if ($post_ID):
|
if ($post_ID):
|
||||||
|
|
||||||
if ( 'future' == $post->post_status )
|
if ( 'future' == $post->post_status ) {
|
||||||
$time = __('Scheduled for:<br />%1$s at %2$s');
|
$time = __('Scheduled for:<br />%1$s at %2$s');
|
||||||
else if ( 'publish' == $post->post_status )
|
$date = $post->post_date;
|
||||||
|
} else if ( 'publish' == $post->post_status ) {
|
||||||
$time = __('Published on:<br />%1$s at %2$s');
|
$time = __('Published on:<br />%1$s at %2$s');
|
||||||
else
|
$date = $post->post_date;
|
||||||
|
} else {
|
||||||
$time = __('Saved on:<br />%1$s at %2$s');
|
$time = __('Saved on:<br />%1$s at %2$s');
|
||||||
|
$date = $post->post_modified;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<p><?php printf($time, mysql2date(get_option('date_format'), $post->post_date), mysql2date(get_option('time_format'), $post->post_date)); ?>
|
<p><?php printf($time, mysql2date(get_option('date_format'), $date), mysql2date(get_option('time_format'), $date)); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue