Ticket #8368: 8368.patch
File 8368.patch, 6.8 KB (added by , 13 years ago) |
---|
-
wp-admin/css/wp-admin.dev.css
3206 3206 border-style: solid; 3207 3207 } 3208 3208 3209 #timestampdiv input[type=radio] { 3210 margin-right: 10px; 3211 } 3209 3212 3213 3210 3214 /*------------------------------------------------------------------------------ 3211 3215 11.1 - Custom Fields 3212 3216 ------------------------------------------------------------------------------*/ -
wp-admin/includes/post.php
101 101 if (!isset( $post_data['ping_status'] )) 102 102 $post_data['ping_status'] = 'closed'; 103 103 104 foreach ( array('aa', 'mm', 'jj', 'hh', 'mn') as $timeunit ) { 105 if ( !empty( $post_data['hidden_' . $timeunit] ) && $post_data['hidden_' . $timeunit] != $post_data[$timeunit] ) { 106 $post_data['edit_date'] = '1'; 107 break; 104 // publish_immediately radio box is only displayed when editing scheduled post 105 // so it's safe to assume that when we encounter this value, the new status is 'publish' 106 if ( ! empty( $post_data['publish_immediately'] ) ) { 107 $post_data['post_status'] = 'publish'; 108 109 // cancel the scheduled date 110 $post_data['post_date'] = current_time( 'mysql' ); 111 $post_data['post_date_gmt'] = ''; 112 } else { 113 foreach ( array('aa', 'mm', 'jj', 'hh', 'mn') as $timeunit ) { 114 if ( !empty( $post_data['hidden_' . $timeunit] ) && $post_data['hidden_' . $timeunit] != $post_data[$timeunit] ) { 115 $post_data['edit_date'] = '1'; 116 break; 117 } 108 118 } 109 119 } 110 120 -
wp-admin/includes/template.php
596 596 597 597 $time_adj = current_time('timestamp'); 598 598 $post_date = ($for_post) ? $post->post_date : $comment->comment_date; 599 $radio_boxes = ( $post->post_status == 'future' ); // only display radio boxes if post is scheduled 599 600 $jj = ($edit) ? mysql2date( 'd', $post_date, false ) : gmdate( 'd', $time_adj ); 600 601 $mm = ($edit) ? mysql2date( 'm', $post_date, false ) : gmdate( 'm', $time_adj ); 601 602 $aa = ($edit) ? mysql2date( 'Y', $post_date, false ) : gmdate( 'Y', $time_adj ); … … 624 625 $minute = '<input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />'; 625 626 626 627 echo '<div class="timestamp-wrap">'; 628 629 if ( $radio_boxes ) { 630 echo '<label for="publish-immediately"><input type="radio" name="publish_immediately" value="1" id="publish-immediately" />' . __( 'Immediately' ) . '</label><br />'; 631 echo '<input type="radio" id="publish-future" name="publish_immediately" value="0" checked="checked" />'; 632 } 633 627 634 /* translators: 1: month input, 2: day input, 3: year input, 4: hour input, 5: minute input */ 628 635 printf(__('%1$s%2$s, %3$s @ %4$s : %5$s'), $month, $day, $year, $hour, $minute); 629 636 -
wp-admin/js/post.dev.js
258 258 }); 259 259 } 260 260 261 $('#aa, #mm, #jj, #hh, #mn').change( function() { 262 $('#publish-future').attr('checked', true); 263 updateText(); 264 }); 265 266 $('#timestampdiv input[type=radio]').change(function(){ 267 updateText(); 268 }); 269 261 270 // categories 262 271 $('.categorydiv').each( function(){ 263 272 var this_id = $(this).attr('id'), noSyncChecks = false, syncChecks, catAddAfter, taxonomyParts, taxonomy, settingName; … … 383 392 $('.timestamp-wrap', '#timestampdiv').removeClass('form-invalid'); 384 393 } 385 394 386 if ( attemptedDate > currentDate && $('#original_post_status').val() != 'future' ) { 395 if ( ( attemptedDate <= currentDate && $('#original_post_status').val() != 'publish' ) || $('#publish-immediately').is(':checked') ) { 396 publishOn = postL10n.publishOn; 397 $('#publish').val( postL10n.publish ); 398 } else if ( attemptedDate > currentDate && attemptedDate.toUTCString() != originalDate.toUTCString() ) { 387 399 publishOn = postL10n.publishOnFuture; 388 400 $('#publish').val( postL10n.schedule ); 389 } else if ( attemptedDate <= currentDate && $('#original_post_status').val() != 'publish' ) {390 publishOn = postL10n.publishOn;391 $('#publish').val( postL10n.publish );392 401 } else { 393 402 publishOn = postL10n.publishOnPast; 394 403 $('#publish').val( postL10n.update ); 395 404 } 396 if ( originalDate.toUTCString() == attemptedDate.toUTCString() ) { //hack 405 if ( $('#publish-immediately').is(':checked') ) { 406 $('#timestamp').html(postL10n.publishImmediately); 407 } else if ( originalDate.toUTCString() == attemptedDate.toUTCString() ) { //hack 397 408 $('#timestamp').html(stamp); 398 409 } else { 399 410 $('#timestamp').html( … … 404 415 hh + ':' + 405 416 mn + '</b> ' 406 417 ); 418 $('#publish-future').attr('checked', true); 407 419 } 408 420 409 421 if ( $('input:radio:checked', '#post-visibility-select').val() == 'private' ) { … … 502 514 $('#hh').val($('#hidden_hh').val()); 503 515 $('#mn').val($('#hidden_mn').val()); 504 516 $('#timestampdiv').siblings('a.edit-timestamp').show(); 517 $('#publish-future').attr('checked', true); 505 518 updateText(); 506 519 return false; 507 520 }); -
wp-includes/post.php
2680 2680 $post_cats = $post['post_category']; 2681 2681 2682 2682 // Drafts shouldn't be assigned a date unless explicitly done so by the user 2683 if ( isset( $post['post_status'] ) && in_array($post['post_status'], array('draft', 'pending', 'auto-draft')) && empty($postarr['edit_date']) && 2684 ('0000-00-00 00:00:00' == $post['post_date_gmt']) ) 2685 $clear_date = true; 2686 else 2687 $clear_date = false; 2683 $clear_date = isset( $post['post_status'] ) && in_array( $post['post_status'], array( 'draft', 'pending', 'auto-draft' ) ) && empty( $postarr['edit_date'] ) 2684 && ( '0000-00-00 00:00:00' == $post['post_date_gmt'] ); 2688 2685 2689 2686 // Merge old and new fields with new fields overwriting old ones. 2690 2687 $postarr = array_merge($post, $postarr); -
wp-includes/script-loader.php
300 300 'publicSticky' => __('Public, Sticky'), 301 301 'password' => __('Password Protected'), 302 302 'privatelyPublished' => __('Privately Published'), 303 'published' => __('Published') 303 'published' => __('Published'), 304 'publishImmediately' => __('Publish <b>immediately</b>'), 304 305 ) ); 305 306 306 307 $scripts->add( 'link', "/wp-admin/js/link$suffix.js", array('wp-lists', 'postbox'), '20110524', 1 );