Changeset 12020
- Timestamp:
- 10/11/2009 12:37:26 AM (15 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-form-advanced.php
r12017 r12020 19 19 20 20 $action = isset($action) ? $action : ''; 21 if ( isset($_GET['message']) ) 21 22 $message = false; 23 if ( isset($_GET['message']) ) { 22 24 $_GET['message'] = absint( $_GET['message'] ); 23 $messages[1] = sprintf(__('Post updated. <a href="%s">View post</a>'), get_permalink($post_ID)); 24 $messages[2] = __('Custom field updated.'); 25 $messages[3] = __('Custom field deleted.'); 26 $messages[4] = __('Post updated.'); 27 $messages[6] = sprintf(__('Post published. <a href="%s">View post</a>'), get_permalink($post_ID)); 28 $messages[7] = __('Post saved.'); 29 $messages[8] = sprintf(__('Post submitted. <a href="%s">Preview post</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ); 30 // translators: Publish box date formt, see http://php.net/date - Same as in meta-boxes.php 31 $messages[9] = sprintf(__('Post scheduled for: <b>%1$s</b>. <a href="%2$s">Preview post</a>'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), get_permalink($post_ID)); 32 $messages[10] = sprintf(__('Draft updated. <a href="%s">Preview</a>'), get_permalink($post_ID)); 33 34 if ( isset($_GET['revision']) ) 35 $messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ); 25 26 switch ( $_GET['message'] ) { 27 case 1: 28 $message = sprintf( __('Post updated. <a target="_blank" href="%s">View post</a>'), get_permalink($post_ID) ); 29 break; 30 case 2: 31 $message = __('Custom field updated.'); 32 break; 33 case 3: 34 $message = __('Custom field deleted.'); 35 break; 36 case 4: 37 $message = __('Post updated.'); 38 break; 39 case 5: 40 if ( isset($_GET['revision']) ) 41 $message = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ); 42 break; 43 case 6: 44 $message = sprintf( __('Post published. <a target="_blank" href="%s">View post</a>'), get_permalink($post_ID) ); 45 break; 46 case 7: 47 $message = __('Post saved.'); 48 break; 49 case 8: 50 $message = sprintf( __('Post submitted. <a target="_blank" href="%s">Preview post</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ); 51 break; 52 case 9: 53 // translators: Publish box date formt, see http://php.net/date - Same as in meta-boxes.php 54 $message = sprintf( __('Post scheduled for: <b>%1$s</b>. <a target="_blank" href="%2$s">Preview post</a>'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), get_permalink($post_ID) ); 55 break; 56 case 10: 57 $message = sprintf( __('Post draft updated. <a target="_blank" href="%s">Preview post</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ); 58 break; 59 } 60 } 36 61 37 62 $notice = false; 38 $notices[1] = __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>.' );39 40 63 if ( 0 == $post_ID ) { 41 64 $form_action = 'post'; … … 52 75 foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) { 53 76 if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) { 54 $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) );77 $notice = sprintf( __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>.' ), get_edit_post_link( $autosave->ID ) ); 55 78 break; 56 79 } … … 117 140 <div id="notice" class="error"><p><?php echo $notice ?></p></div> 118 141 <?php endif; ?> 119 <?php if ( isset($_GET['message'])) : ?>120 <div id="message" class="updated fade"><p><?php echo $message s[$_GET['message']]; ?></p></div>142 <?php if ( $message ) : ?> 143 <div id="message" class="updated fade"><p><?php echo $message; ?></p></div> 121 144 <?php endif; ?> 122 145 <form name="post" action="post.php" method="post" id="post"> -
trunk/wp-admin/edit-page-form.php
r11897 r12020 21 21 $temp_ID = 0; 22 22 23 if ( isset($_GET['message']) ) 23 $message = false; 24 if ( isset($_GET['message']) ) { 24 25 $_GET['message'] = absint( $_GET['message'] ); 25 $messages[1] = sprintf(__('Page updated. <a href="%s">View page</a>'), get_permalink($post_ID));26 $messages[2] = __('Custom field updated.');27 $messages[3] = __('Custom field deleted.');28 $messages[5] = sprintf(__('Page published. <a href="%s">View page</a>'), get_permalink($post_ID));29 $messages[6] = sprintf(__('Page submitted. <a href="%s">Preview page</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );30 // translators: Publish box date formt, see http://php.net/date - Same as in meta-boxes.php31 $messages[7] = sprintf(__('Page scheduled for: <b>%1$s</b>. <a href="%2$s">Preview post</a>'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), get_permalink($post_ID));32 26 33 if ( isset($_GET['revision']) ) 34 $messages[5] = sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ); 27 switch ( $_GET['message'] ) { 28 case 1: 29 $message = sprintf( __('Page updated. <a target="_blank" href="%s">View page</a>'), get_permalink($post_ID) ); 30 break; 31 case 2: 32 $message = __('Custom field updated.'); 33 break; 34 case 3: 35 $message = __('Custom field deleted.'); 36 break; 37 case 4: 38 $message = sprintf( __('Page published. <a target="_blank" href="%s">View page</a>'), get_permalink($post_ID) ); 39 break; 40 case 5: 41 if ( isset($_GET['revision']) ) 42 $message = sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ); 43 break; 44 case 6: 45 $message = sprintf( __('Page submitted. <a target="_blank" href="%s">Preview page</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ); 46 break; 47 case 7: 48 // translators: Publish box date formt, see http://php.net/date - Same as in meta-boxes.php 49 $message = sprintf( __('Page scheduled for: <b>%1$s</b>. <a target="_blank" href="%2$s">Preview page</a>'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), get_permalink($post_ID) ); 50 break; 51 case 8: 52 $message = sprintf( __('Page draft updated. <a target="_blank" href="%s">Preview page</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ); 53 break; 54 } 55 } 35 56 36 57 $notice = false; 37 $notices[1] = __( 'There is an autosave of this page that is more recent than the version below. <a href="%s">View the autosave</a>.' );38 39 58 if ( 0 == $post_ID) { 40 59 $form_action = 'post'; … … 49 68 $autosave = wp_get_post_autosave( $post_ID ); 50 69 if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) 51 $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) );70 $notice = sprintf( __( 'There is an autosave of this page that is more recent than the version below. <a href="%s">View the autosave</a>.' ), get_edit_post_link( $autosave->ID ) ); 52 71 } 53 72 … … 88 107 <div id="notice" class="error"><p><?php echo $notice ?></p></div> 89 108 <?php endif; ?> 90 <?php if ( isset($_GET['message'])) : ?>91 <div id="message" class="updated fade"><p><?php echo $message s[$_GET['message']]; ?></p></div>109 <?php if ( $message ) : ?> 110 <div id="message" class="updated fade"><p><?php echo $message; ?></p></div> 92 111 <?php endif; ?> 93 112 -
trunk/wp-admin/page.php
r11986 r12020 36 36 } elseif ( 'post' == $_POST['originalaction'] && !empty($_POST['mode']) && 'sidebar' == $_POST['mode'] ) { 37 37 $location = 'sidebar.php?a=b'; 38 } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) ) { 38 } elseif ( isset($_POST['save']) || isset($_POST['publish']) ) { 39 $status = get_post_status( $page_ID ); 40 39 41 if ( isset( $_POST['publish'] ) ) { 40 switch ( get_post_status( $page_ID )) {42 switch ( $status ) { 41 43 case 'pending': 42 $ location = add_query_arg( 'message', 6, get_edit_post_link( $page_ID, 'url' ) );44 $message = 6; 43 45 break; 44 46 case 'future': 45 $ location = add_query_arg( 'message', 7, get_edit_post_link( $page_ID, 'url' ) );47 $message = 7; 46 48 break; 47 49 default: 48 $ location = add_query_arg( 'message', 5, get_edit_post_link( $page_ID, 'url' ) );50 $message = 4; 49 51 } 50 52 } else { 51 $location = add_query_arg( 'message', 1, get_edit_post_link( $page_ID, 'url' ) );53 $message = 'draft' == $status ? 8 : 1; 52 54 } 55 56 $location = add_query_arg( 'message', $message, get_edit_post_link( $page_ID, 'url' ) ); 53 57 } elseif ( isset($_POST['addmeta']) ) { 54 58 $location = add_query_arg( 'message', 2, wp_get_referer() ); -
trunk/wp-admin/post.php
r12017 r12020 41 41 } elseif ( isset($_POST['save']) || isset($_POST['publish']) ) { 42 42 $status = get_post_status( $post_ID ); 43 $link = get_edit_post_link( $post_ID, 'url' );44 43 45 44 if ( isset( $_POST['publish'] ) ) { … … 58 57 } 59 58 60 $location = add_query_arg( 'message', $message, $link);59 $location = add_query_arg( 'message', $message, get_edit_post_link( $post_ID, 'url' ) ); 61 60 } elseif ( isset($_POST['addmeta']) && $_POST['addmeta'] ) { 62 61 $location = add_query_arg( 'message', 2, wp_get_referer() );
Note: See TracChangeset
for help on using the changeset viewer.