Ticket #31858: 31858.2.patch
File 31858.2.patch, 4.7 KB (added by , 9 years ago) |
---|
-
edit-form-advanced.php
81 81 } 82 82 83 83 $messages = array(); 84 $post_preview_url = get_preview_post_link( $post );85 84 86 $preview_ link_html = $scheduled_link_html = $view_post_html = '';85 $preview_url = get_preview_post_link( $post ); 87 86 87 $preview_post_link_html = $scheduled_post_link_html = $view_post_html = ''; 88 $preview_page_link_html = $scheduled_page_link_html = $view_page_html = ''; 89 88 90 $viewable = is_post_type_viewable( $post_type_object ); 89 91 90 92 if ( $viewable ) { 91 // Preview link.92 $preview_ link_html = sprintf( ' <a target="_blank" href="%s">%s</a>',93 esc_url( $p ost_preview_url ),93 // Preview post link. 94 $preview_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', 95 esc_url( $preview_url ), 94 96 __( 'Preview post' ) 95 97 ); 96 98 97 // Scheduled p review link.98 $scheduled_ link_html = sprintf( ' <a target="_blank" href="%s">%s</a>',99 // Scheduled post preview link. 100 $scheduled_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', 99 101 esc_url( $permalink ), 100 102 __( 'Preview post' ) 101 103 ); 102 104 103 105 // View post link. 104 $view_post_html = sprintf( ' <a href="% s">%s</a>',106 $view_post_html = sprintf( ' <a href="%1$s">%2$s</a>', 105 107 esc_url( $permalink ), 106 108 __( 'View post' ) 107 109 ); 110 111 // Preview page link. 112 $preview_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', 113 esc_url( $preview_url ), 114 __( 'Preview page' ) 115 ); 116 117 // Scheduled page preview link. 118 $scheduled_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', 119 esc_url( $permalink ), 120 __( 'Preview page' ) 121 ); 122 123 // View page link. 124 $view_page_html = sprintf( ' <a href="%1$s">%2$s</a>', 125 esc_url( $permalink ), 126 __( 'View page' ) 127 ); 128 108 129 } 109 130 110 131 /* translators: Publish box date format, see http://php.net/date */ 111 132 $scheduled_date = date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_date ) ); 133 112 134 $messages['post'] = array( 113 135 0 => '', // Unused. Messages start at index 1. 114 136 1 => __( 'Post updated.' ) . $view_post_html, 115 2 => __( 'Custom field updated.'),116 3 => __( 'Custom field deleted.'),117 4 => __( 'Post updated.'),137 2 => __( 'Custom field updated.' ), 138 3 => __( 'Custom field deleted.' ), 139 4 => __( 'Post updated.' ), 118 140 /* translators: %s: date and time of the revision */ 119 141 5 => isset($_GET['revision']) ? sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, 120 142 6 => __( 'Post published.' ) . $view_post_html, 121 7 => __( 'Post saved.'),122 8 => __( 'Post submitted.' ) . $preview_ link_html,123 9 => sprintf( __( 'Post scheduled for: <strong>%1$s</strong>' ), $scheduled_date ) . $scheduled_link_html,124 10 => __( 'Post draft updated.' ) . $preview_ link_html,143 7 => __( 'Post saved.' ), 144 8 => __( 'Post submitted.' ) . $preview_post_link_html, 145 9 => sprintf( __( 'Post scheduled for: %s' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html, 146 10 => __( 'Post draft updated.' ) . $preview_post_link_html, 125 147 ); 126 127 $page_preview_url = get_preview_post_link( $post );128 129 148 $messages['page'] = array( 130 149 0 => '', // Unused. Messages start at index 1. 131 1 => sprintf( __('Page updated. <a href="%s">View page</a>'), esc_url( $permalink ) ), 132 2 => __('Custom field updated.'), 133 3 => __('Custom field deleted.'), 134 4 => __('Page updated.'), 150 1 => __( 'Page updated.' ) . $view_page_html, 151 2 => __( 'Custom field updated.' ), 152 3 => __( 'Custom field deleted.' ), 153 4 => __( 'Page updated.' ), 154 /* translators: %s: date and time of the revision */ 135 155 5 => isset($_GET['revision']) ? sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, 136 6 => sprintf( __('Page published. <a href="%s">View page</a>'), esc_url( $permalink ) ),137 7 => __( 'Page saved.'),138 8 => sprintf( __('Page submitted. <a target="_blank" href="%s">Preview page</a>'), esc_url( $page_preview_url ) ),139 9 => sprintf( __( 'Page scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview page</a>'), date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_date ) ), esc_url( $permalink ) ),140 10 => sprintf( __('Page draft updated. <a target="_blank" href="%s">Preview page</a>'), esc_url( $page_preview_url ) ),156 6 => __( 'Page published.' ) . $view_page_html, 157 7 => __( 'Page saved.' ), 158 8 => __( 'Page submitted.' ) . $preview_page_link_html, 159 9 => sprintf( __( 'Page scheduled for: %s' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_page_link_html, 160 10 => __( 'Page draft updated.' ) . $preview_page_link_html, 141 161 ); 142 162 $messages['attachment'] = array_fill( 1, 10, __( 'Media attachment updated.' ) ); // Hack, for now. 143 163