Bring Edit Page screen up to parity with Edit Post screen WRT timestamps. see #6250
git-svn-id: https://develop.svn.wordpress.org/trunk@7341 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8ebb2c3ca6
commit
ecbc4d48f1
|
@ -76,21 +76,20 @@ else
|
||||||
|
|
||||||
<p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> /> <?php _e('Keep this page private') ?></label></p>
|
<p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> /> <?php _e('Keep this page private') ?></label></p>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if ($post_ID) {
|
if ($post_ID) {
|
||||||
|
if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
|
||||||
if ( 'future' == $post->post_status ) {
|
|
||||||
$stamp = __('Scheduled for:<br />%1$s at %2$s');
|
$stamp = __('Scheduled for:<br />%1$s at %2$s');
|
||||||
} else if ( 'publish' == $post->post_status ) {
|
} else if ( 'publish' == $post->post_status ) { // already published
|
||||||
$stamp = __('%1$s at %2$s');
|
$stamp = __('Published on:<br />%1$s at %2$s');
|
||||||
} else {
|
} else if ( '0000-00-00 00:00:00' == $post->post_date ) { // draft, 1 or more saves, no date specified
|
||||||
$stamp = __('Saved on:<br />%1$s at %2$s');
|
$stamp = __('Publish immediately');
|
||||||
|
} else { // draft, 1 or more saves, date specified
|
||||||
|
$stamp = __('Publish on:<br />%1$s at %2$s');
|
||||||
}
|
}
|
||||||
|
|
||||||
$date = mysql2date(get_option('date_format'), $post->post_date);
|
$date = mysql2date(get_option('date_format'), $post->post_date);
|
||||||
$time = mysql2date(get_option('time_format'), $post->post_date);
|
$time = mysql2date(get_option('time_format'), $post->post_date);
|
||||||
} else {
|
} else { // draft (no saves, and thus no date specified)
|
||||||
$stamp = __('%1$s at %2$s');
|
$stamp = __('Publish immediately');
|
||||||
$date = mysql2date(get_option('date_format'), current_time('mysql'));
|
$date = mysql2date(get_option('date_format'), current_time('mysql'));
|
||||||
$time = mysql2date(get_option('time_format'), current_time('mysql'));
|
$time = mysql2date(get_option('time_format'), current_time('mysql'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,15 @@ jQuery(document).ready( function() {
|
||||||
jQuery('.edit-timestamp').click(function () {
|
jQuery('.edit-timestamp').click(function () {
|
||||||
if (jQuery('#timestampdiv').is(":hidden")) {
|
if (jQuery('#timestampdiv').is(":hidden")) {
|
||||||
jQuery('#timestampdiv').slideDown("normal");
|
jQuery('#timestampdiv').slideDown("normal");
|
||||||
|
jQuery('.edit-timestamp').text(postL10n.cancel);
|
||||||
} else {
|
} else {
|
||||||
jQuery('#timestampdiv').hide();
|
jQuery('#timestampdiv').hide();
|
||||||
|
jQuery('#mm').val(jQuery('#hidden_mm').val());
|
||||||
|
jQuery('#jj').val(jQuery('#hidden_jj').val());
|
||||||
|
jQuery('#aa').val(jQuery('#hidden_aa').val());
|
||||||
|
jQuery('#hh').val(jQuery('#hidden_hh').val());
|
||||||
|
jQuery('#mn').val(jQuery('#hidden_mn').val());
|
||||||
|
jQuery('.edit-timestamp').text(postL10n.edit);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
|
@ -151,6 +151,10 @@ class WP_Scripts {
|
||||||
'edit' => __('Edit'),
|
'edit' => __('Edit'),
|
||||||
) );
|
) );
|
||||||
$this->add( 'page', '/wp-admin/js/page.js', array('jquery', 'slug', 'postbox'), '20080208' );
|
$this->add( 'page', '/wp-admin/js/page.js', array('jquery', 'slug', 'postbox'), '20080208' );
|
||||||
|
$this->localize( 'page', 'postL10n', array(
|
||||||
|
'cancel' => __('Cancel'),
|
||||||
|
'edit' => __('Edit'),
|
||||||
|
) );
|
||||||
$this->add( 'link', '/wp-admin/js/link.js', array('jquery-ui-tabs', 'wp-lists', 'postbox'), '20080131' );
|
$this->add( 'link', '/wp-admin/js/link.js', array('jquery-ui-tabs', 'wp-lists', 'postbox'), '20080131' );
|
||||||
$this->add( 'comment', '/wp-admin/js/comment.js', array('postbox'), '20080219' );
|
$this->add( 'comment', '/wp-admin/js/comment.js', array('postbox'), '20080219' );
|
||||||
$this->add( 'media-upload', '/wp-admin/js/media-upload.js', false, '20080109' );
|
$this->add( 'media-upload', '/wp-admin/js/media-upload.js', false, '20080109' );
|
||||||
|
|
Loading…
Reference in New Issue