diff --git wp-admin/css/wp-admin.dev.css wp-admin/css/wp-admin.dev.css
index 0a70bd5..cce3512 100644
|
|
|
td.post-title p, td.plugin-title p { |
| 2339 | 2339 | border-style: solid; |
| 2340 | 2340 | } |
| 2341 | 2341 | |
| | 2342 | #timestampdiv input[type=radio] { |
| | 2343 | margin-right:10px; |
| | 2344 | } |
| 2342 | 2345 | |
| 2343 | 2346 | /*------------------------------------------------------------------------------ |
| 2344 | 2347 | 11.1 - Custom Fields |
diff --git wp-admin/includes/post.php wp-admin/includes/post.php
index 510d59f..654a132 100644
|
|
|
function _wp_translate_postdata( $update = false, $post_data = null ) { |
| 94 | 94 | if (!isset( $post_data['ping_status'] )) |
| 95 | 95 | $post_data['ping_status'] = 'closed'; |
| 96 | 96 | |
| 97 | | foreach ( array('aa', 'mm', 'jj', 'hh', 'mn') as $timeunit ) { |
| 98 | | if ( !empty( $post_data['hidden_' . $timeunit] ) && $post_data['hidden_' . $timeunit] != $post_data[$timeunit] ) { |
| 99 | | $post_data['edit_date'] = '1'; |
| 100 | | break; |
| | 97 | // publish_immediately radio box is only displayed when editing scheduled post |
| | 98 | // so it's safe to assume that when we encounter this value, the new status is 'publish' |
| | 99 | if ( ! empty( $post_data['publish_immediately'] ) ) { |
| | 100 | $post_data['post_status'] = 'publish'; |
| | 101 | |
| | 102 | // cancel the scheduled date |
| | 103 | $post_data['post_date'] = current_time( 'mysql' ); |
| | 104 | $post_data['post_date_gmt'] = ''; |
| | 105 | } else { |
| | 106 | foreach ( array('aa', 'mm', 'jj', 'hh', 'mn') as $timeunit ) { |
| | 107 | if ( !empty( $post_data['hidden_' . $timeunit] ) && $post_data['hidden_' . $timeunit] != $post_data[$timeunit] ) { |
| | 108 | $post_data['edit_date'] = '1'; |
| | 109 | break; |
| | 110 | } |
| 101 | 111 | } |
| 102 | 112 | } |
| 103 | 113 | |
diff --git wp-admin/includes/template.php wp-admin/includes/template.php
index d9790be..b31642c 100644
|
|
|
function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { |
| 594 | 594 | |
| 595 | 595 | $time_adj = current_time('timestamp'); |
| 596 | 596 | $post_date = ($for_post) ? $post->post_date : $comment->comment_date; |
| | 597 | $radio_boxes = ( $post->post_status == 'future' ); // only display radio boxes if post is scheduled |
| 597 | 598 | $jj = ($edit) ? mysql2date( 'd', $post_date, false ) : gmdate( 'd', $time_adj ); |
| 598 | 599 | $mm = ($edit) ? mysql2date( 'm', $post_date, false ) : gmdate( 'm', $time_adj ); |
| 599 | 600 | $aa = ($edit) ? mysql2date( 'Y', $post_date, false ) : gmdate( 'Y', $time_adj ); |
| … |
… |
function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { |
| 622 | 623 | $minute = '<input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />'; |
| 623 | 624 | |
| 624 | 625 | echo '<div class="timestamp-wrap">'; |
| | 626 | |
| | 627 | if ( $radio_boxes ) { |
| | 628 | echo '<label for="publish-immediately"><input type="radio" name="publish_immediately" value="1" id="publish-immediately" />' . __( 'Immediately' ) . '</label><br />'; |
| | 629 | echo '<input type="radio" id="publish-future" name="publish_immediately" value="0" checked="checked" />'; |
| | 630 | } |
| | 631 | |
| 625 | 632 | /* translators: 1: month input, 2: day input, 3: year input, 4: hour input, 5: minute input */ |
| 626 | 633 | printf(__('%1$s%2$s, %3$s @ %4$s : %5$s'), $month, $day, $year, $hour, $minute); |
| 627 | 634 | |
diff --git wp-admin/js/post.dev.js wp-admin/js/post.dev.js
index 1c39edf..3b53913 100644
|
|
|
jQuery(document).ready( function($) { |
| 249 | 249 | }); |
| 250 | 250 | } |
| 251 | 251 | |
| | 252 | $('#aa, #mm, #jj, #hh, #mn').change(function(){ |
| | 253 | $('#publish-future').attr('checked', true); |
| | 254 | updateText(); |
| | 255 | }); |
| | 256 | |
| | 257 | $('#timestampdiv input[type=radio]').change(function(){ |
| | 258 | updateText(); |
| | 259 | }); |
| | 260 | |
| 252 | 261 | // categories |
| 253 | 262 | $('.categorydiv').each( function(){ |
| 254 | 263 | var this_id = $(this).attr('id'), noSyncChecks = false, syncChecks, catAddAfter, taxonomyParts, taxonomy, settingName; |
| … |
… |
jQuery(document).ready( function($) { |
| 374 | 383 | $('.timestamp-wrap', '#timestampdiv').removeClass('form-invalid'); |
| 375 | 384 | } |
| 376 | 385 | |
| 377 | | if ( attemptedDate > currentDate && $('#original_post_status').val() != 'future' ) { |
| 378 | | publishOn = postL10n.publishOnFuture; |
| 379 | | $('#publish').val( postL10n.schedule ); |
| 380 | | } else if ( attemptedDate <= currentDate && $('#original_post_status').val() != 'publish' ) { |
| | 386 | if ( ( attemptedDate <= currentDate && $('#original_post_status').val() != 'publish' ) || $('#publish-immediately').is(':checked') ) { |
| 381 | 387 | publishOn = postL10n.publishOn; |
| 382 | 388 | $('#publish').val( postL10n.publish ); |
| | 389 | } else if ( attemptedDate > currentDate && attemptedDate.toUTCString() != originalDate.toUTCString() ) { |
| | 390 | publishOn = postL10n.publishOnFuture; |
| | 391 | $('#publish').val( postL10n.schedule ); |
| 383 | 392 | } else { |
| 384 | 393 | publishOn = postL10n.publishOnPast; |
| 385 | 394 | $('#publish').val( postL10n.update ); |
| 386 | 395 | } |
| 387 | | if ( originalDate.toUTCString() == attemptedDate.toUTCString() ) { //hack |
| | 396 | if ( $('#publish-immediately').is(':checked') ) { |
| | 397 | $('#timestamp').html(postL10n.publishImmediately); |
| | 398 | } else if ( originalDate.toUTCString() == attemptedDate.toUTCString() ) { //hack |
| 388 | 399 | $('#timestamp').html(stamp); |
| 389 | 400 | } else { |
| 390 | 401 | $('#timestamp').html( |
| … |
… |
jQuery(document).ready( function($) { |
| 395 | 406 | hh + ':' + |
| 396 | 407 | mn + '</b> ' |
| 397 | 408 | ); |
| | 409 | $('#publish-future').attr('checked', true); |
| 398 | 410 | } |
| 399 | 411 | |
| 400 | 412 | if ( $('input:radio:checked', '#post-visibility-select').val() == 'private' ) { |
| … |
… |
jQuery(document).ready( function($) { |
| 493 | 505 | $('#hh').val($('#hidden_hh').val()); |
| 494 | 506 | $('#mn').val($('#hidden_mn').val()); |
| 495 | 507 | $('#timestampdiv').siblings('a.edit-timestamp').show(); |
| | 508 | $('#publish-future').attr('checked', true); |
| 496 | 509 | updateText(); |
| 497 | 510 | return false; |
| 498 | 511 | }); |
diff --git wp-includes/post.php wp-includes/post.php
index 3c3759e..b0c30eb 100644
|
|
|
function wp_update_post($postarr = array()) { |
| 2653 | 2653 | $post_cats = $postarr['post_category']; |
| 2654 | 2654 | else |
| 2655 | 2655 | $post_cats = $post['post_category']; |
| 2656 | | |
| | 2656 | |
| 2657 | 2657 | // Drafts shouldn't be assigned a date unless explicitly done so by the user |
| 2658 | | if ( isset( $post['post_status'] ) && in_array($post['post_status'], array('draft', 'pending', 'auto-draft')) && empty($postarr['edit_date']) && |
| 2659 | | ('0000-00-00 00:00:00' == $post['post_date_gmt']) ) |
| 2660 | | $clear_date = true; |
| 2661 | | else |
| 2662 | | $clear_date = false; |
| | 2658 | $clear_date = isset( $post['post_status'] ) && in_array( $post['post_status'], array( 'draft', 'pending', 'auto-draft' ) ) && empty( $postarr['edit_date'] ) |
| | 2659 | && ( '0000-00-00 00:00:00' == $post['post_date_gmt'] ); |
| 2663 | 2660 | |
| 2664 | 2661 | // Merge old and new fields with new fields overwriting old ones. |
| 2665 | 2662 | $postarr = array_merge($post, $postarr); |
diff --git wp-includes/script-loader.php wp-includes/script-loader.php
index 6f07db5..4a6f0b5 100644
|
|
|
function wp_default_scripts( &$scripts ) { |
| 338 | 338 | 'password' => __('Password Protected'), |
| 339 | 339 | 'privatelyPublished' => __('Privately Published'), |
| 340 | 340 | 'published' => __('Published'), |
| 341 | | 'l10n_print_after' => 'try{convertEntities(postL10n);}catch(e){};' |
| | 341 | 'l10n_print_after' => 'try{convertEntities(postL10n);}catch(e){};', |
| | 342 | 'publishImmediately' => __('Publish <b>immediately</b>'), |
| 342 | 343 | ) ); |
| 343 | 344 | |
| 344 | 345 | $scripts->add( 'link', "/wp-admin/js/link$suffix.js", array('wp-lists', 'postbox'), '20090526' ); |