Changeset 46083 for trunk/src/wp-admin/includes/meta-boxes.php
- Timestamp:
- 09/08/2019 11:23:26 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/meta-boxes.php
r46071 r46083 195 195 196 196 <?php 197 /* translators: Publish box date string. 1: Date, 2: Time. See https://secure.php.net/date */ 198 $date_string = __( '%1$s at %2$s' ); 197 199 /* translators: Publish box date format, see https://secure.php.net/date */ 198 $datef = __( 'M j, Y @ H:i' ); 200 $date_format = _x( 'M j, Y', 'publish box date format' ); 201 /* translators: Publish box time format, see https://secure.php.net/date */ 202 $time_format = _x( 'H:i', 'publish box time format' ); 203 199 204 if ( 0 != $post->ID ) { 200 205 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date 201 206 /* translators: Post date information. %s: Date on which the post is currently scheduled to be published. */ 202 $stamp = __( 'Scheduled for: <b>%s</b>' );207 $stamp = __( 'Scheduled for: %s' ); 203 208 } elseif ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published 204 209 /* translators: Post date information. %s: Date on which the post was published. */ 205 $stamp = __( 'Published on: <b>%s</b>' );210 $stamp = __( 'Published on: %s' ); 206 211 } elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified 207 212 $stamp = __( 'Publish <b>immediately</b>' ); 208 213 } elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified 209 214 /* translators: Post date information. %s: Date on which the post is to be published. */ 210 $stamp = __( 'Schedule for: <b>%s</b>' );215 $stamp = __( 'Schedule for: %s' ); 211 216 } else { // draft, 1 or more saves, date specified 212 217 /* translators: Post date information. %s: Date on which the post is to be published. */ 213 $stamp = __( 'Publish on: <b>%s</b>' ); 214 } 215 $date = date_i18n( $datef, strtotime( $post->post_date ) ); 218 $stamp = __( 'Publish on: %s' ); 219 } 220 $date = sprintf( 221 $date_string, 222 date_i18n( $date_format, strtotime( $post->post_date ) ), 223 date_i18n( $time_format, strtotime( $post->post_date ) ) 224 ); 216 225 } else { // draft (no saves, and thus no date specified) 217 226 $stamp = __( 'Publish <b>immediately</b>' ); 218 $date = date_i18n( $datef, strtotime( current_time( 'mysql' ) ) ); 227 $date = sprintf( 228 $date_string, 229 date_i18n( $date_format, strtotime( current_time( 'mysql' ) ) ), 230 date_i18n( $time_format, strtotime( current_time( 'mysql' ) ) ) 231 ); 219 232 } 220 233 … … 235 248 <div class="misc-pub-section curtime misc-pub-curtime"> 236 249 <span id="timestamp"> 237 <?php printf( $stamp, $date ); ?></span> 238 <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span></a> 250 <?php printf( $stamp, '<b>' . $date . '</b>' ); ?> 251 </span> 252 <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" role="button"> 253 <span aria-hidden="true"><?php _e( 'Edit' ); ?></span> 254 <span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span> 255 </a> 239 256 <fieldset id="timestampdiv" class="hide-if-js"> 240 <legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend>257 <legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend> 241 258 <?php touch_time( ( $action === 'edit' ), 1 ); ?> 242 259 </fieldset>
Note: See TracChangeset
for help on using the changeset viewer.