mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Make date format consistent across the admin
The 'date_format' and 'time_format' options shouldn't affect the backend. See #30864 Built from https://develop.svn.wordpress.org/trunk@35811 git-svn-id: http://core.svn.wordpress.org/trunk@35775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
07339e61c0
commit
657d3b50af
@ -89,8 +89,8 @@ if ( ! wp_next_scheduled( 'wp_scheduled_delete' ) && ! wp_installing() )
|
||||
|
||||
set_screen_options();
|
||||
|
||||
$date_format = get_option('date_format');
|
||||
$time_format = get_option('time_format');
|
||||
$date_format = __( 'F j, Y' );
|
||||
$time_format = __( 'g:i a' );
|
||||
|
||||
wp_enqueue_script( 'common' );
|
||||
|
||||
|
@ -199,7 +199,7 @@ if ( $comment->comment_approved != '0' ) { // if not unapproved
|
||||
printf( __( '%1$s at %2$s' ),
|
||||
/* translators: comment date format. See http://php.net/date */
|
||||
get_comment_date( __( 'Y/m/d' ), $comment ),
|
||||
get_comment_date( get_option( 'time_format' ), $comment )
|
||||
get_comment_date( __( 'g:i a' ), $comment )
|
||||
);
|
||||
?></a>
|
||||
</td>
|
||||
|
@ -631,9 +631,9 @@ if ( post_type_supports($post_type, 'editor') ) {
|
||||
if ( 'auto-draft' != $post->post_status ) {
|
||||
echo '<span id="last-edit">';
|
||||
if ( $last_user = get_userdata( get_post_meta( $post_ID, '_edit_last', true ) ) ) {
|
||||
printf(__('Last edited by %1$s on %2$s at %3$s'), esc_html( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
|
||||
printf( __( 'Last edited by %1$s on %2$s at %3$s' ), esc_html( $last_user->display_name ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) );
|
||||
} else {
|
||||
printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
|
||||
printf( __( 'Last edited on %1$s at %2$s' ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) );
|
||||
}
|
||||
echo '</span>';
|
||||
} ?>
|
||||
|
@ -1237,7 +1237,7 @@ function wp_ajax_add_meta() {
|
||||
$post_data['post_type'] = $post->post_type;
|
||||
$post_data['post_status'] = 'draft';
|
||||
$now = current_time('timestamp', 1);
|
||||
$post_data['post_title'] = sprintf( __( 'Draft created on %1$s at %2$s' ), date( get_option( 'date_format' ), $now ), date( get_option( 'time_format' ), $now ) );
|
||||
$post_data['post_title'] = sprintf( __( 'Draft created on %1$s at %2$s' ), date( __( 'F j, Y' ), $now ), date( __( 'g:i a' ), $now ) );
|
||||
|
||||
$pid = edit_post( $post_data );
|
||||
if ( $pid ) {
|
||||
@ -2227,11 +2227,11 @@ function wp_ajax_wp_fullscreen_save_post() {
|
||||
}
|
||||
|
||||
if ( $post ) {
|
||||
$last_date = mysql2date( get_option('date_format'), $post->post_modified );
|
||||
$last_time = mysql2date( get_option('time_format'), $post->post_modified );
|
||||
$last_date = mysql2date( __( 'F j, Y' ), $post->post_modified );
|
||||
$last_time = mysql2date( __( 'g:i a' ), $post->post_modified );
|
||||
} else {
|
||||
$last_date = date_i18n( get_option('date_format') );
|
||||
$last_time = date_i18n( get_option('time_format') );
|
||||
$last_date = date_i18n( __( 'F j, Y' ) );
|
||||
$last_time = date_i18n( __( 'g:i a' ) );
|
||||
}
|
||||
|
||||
if ( $last_id = get_post_meta( $post_id, '_edit_last', true ) ) {
|
||||
|
@ -720,7 +720,7 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
printf( __( '%1$s at %2$s' ),
|
||||
/* translators: comment date format. See http://php.net/date */
|
||||
get_comment_date( __( 'Y/m/d' ), $comment ),
|
||||
get_comment_date( get_option( 'time_format' ), $comment )
|
||||
get_comment_date( __( 'g:i a' ), $comment )
|
||||
);
|
||||
echo '</a>';
|
||||
echo '</div>';
|
||||
|
@ -550,7 +550,7 @@ function wp_dashboard_recent_drafts( $drafts = false ) {
|
||||
$title = _draft_or_post_title( $draft->ID );
|
||||
echo "<li>\n";
|
||||
echo '<div class="draft-title"><a href="' . esc_url( $url ) . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $title ) ) . '">' . esc_html( $title ) . '</a>';
|
||||
echo '<time datetime="' . get_the_time( 'c', $draft ) . '">' . get_the_time( get_option( 'date_format' ), $draft ) . '</time></div>';
|
||||
echo '<time datetime="' . get_the_time( 'c', $draft ) . '">' . get_the_time( __( 'F j, Y' ), $draft ) . '</time></div>';
|
||||
if ( $the_content = wp_trim_words( $draft->post_content, 10 ) ) {
|
||||
echo '<p>' . $the_content . '</p>';
|
||||
}
|
||||
|
@ -1455,7 +1455,7 @@ function get_media_item( $attachment_id, $args = null ) {
|
||||
<td>
|
||||
<p><strong>" . __('File name:') . "</strong> $filename</p>
|
||||
<p><strong>" . __('File type:') . "</strong> $post->post_mime_type</p>
|
||||
<p><strong>" . __('Upload date:') . "</strong> " . mysql2date( get_option('date_format'), $post->post_date ). '</p>';
|
||||
<p><strong>" . __('Upload date:') . "</strong> " . mysql2date( __( 'F j, Y' ), $post->post_date ). '</p>';
|
||||
if ( !empty( $media_dims ) )
|
||||
$item .= "<p><strong>" . __('Dimensions:') . "</strong> $media_dims</p>\n";
|
||||
|
||||
|
@ -73,7 +73,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
<tr>
|
||||
<th scope="row"><label for="home"><?php _e('Site Address (URL)') ?></label></th>
|
||||
<td><input name="home" type="url" id="home" aria-describedby="home-description" value="<?php form_option( 'home' ); ?>"<?php disabled( defined( 'WP_HOME' ) ); ?> class="regular-text code<?php if ( defined( 'WP_HOME' ) ) echo ' disabled' ?>" />
|
||||
<?php if ( ! defined( 'WP_HOME' ) ) : ?>
|
||||
<?php if ( ! defined( 'WP_HOME' ) ) : ?>
|
||||
<p class="description" id="home-description"><?php _e( 'Enter the address here if you <a href="https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory">want your site home page to be different from your WordPress installation directory.</a>' ); ?></p></td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
@ -198,7 +198,7 @@ if ( empty($tzstring) ) { // Create a UTC+- zone if no timezone string exists
|
||||
// Add the difference between the current offset and the new offset to ts to get the correct transition time from date_i18n().
|
||||
printf( $message,
|
||||
'<code>' . date_i18n(
|
||||
get_option( 'date_format' ) . ' ' . get_option( 'time_format' ),
|
||||
__( 'F j, Y' ) . ' ' . __( 'g:i a' ),
|
||||
$tr['ts'] + ( $tz_offset - $tr['offset'] )
|
||||
) . '</code>'
|
||||
);
|
||||
|
@ -574,7 +574,7 @@ if ( 'upgrade-core' == $action ) {
|
||||
|
||||
echo '<p>';
|
||||
/* translators: %1 date, %2 time. */
|
||||
printf( __('Last checked on %1$s at %2$s.'), date_i18n( get_option( 'date_format' ) ), date_i18n( get_option( 'time_format' ) ) );
|
||||
printf( __( 'Last checked on %1$s at %2$s.' ), date_i18n( __( 'F j, Y' ) ), date_i18n( __( 'g:i a' ) ) );
|
||||
echo ' <a class="button" href="' . esc_url( self_admin_url('update-core.php?force-check=1') ) . '">' . __( 'Check Again' ) . '</a>';
|
||||
echo '</p>';
|
||||
|
||||
|
@ -2979,7 +2979,7 @@ function wp_prepare_attachment_for_js( $attachment ) {
|
||||
'type' => $type,
|
||||
'subtype' => $subtype,
|
||||
'icon' => wp_mime_type_icon( $attachment->ID ),
|
||||
'dateFormatted' => mysql2date( get_option('date_format'), $attachment->post_date ),
|
||||
'dateFormatted' => mysql2date( __( 'F j, Y' ), $attachment->post_date ),
|
||||
'nonces' => array(
|
||||
'update' => false,
|
||||
'delete' => false,
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.5-alpha-35810';
|
||||
$wp_version = '4.5-alpha-35811';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user