Ticket #15930: 15930.diff
File 15930.diff, 7.2 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/class-wp-posts-list-table.php
204 204 205 205 if ( $this->is_trash ) { 206 206 $actions['untrash'] = __( 'Restore' ); 207 } else {208 $actions['edit'] = __( 'Edit' );209 207 } 210 208 209 $actions['edit'] = __( 'Edit' ); 210 211 211 if ( current_user_can( $post_type_obj->cap->delete_posts ) ) { 212 212 if ( $this->is_trash || ! EMPTY_TRASH_DAYS ) { 213 213 $actions['delete'] = __( 'Delete Permanently' ); … … 667 667 echo '<a href="' . esc_url( add_query_arg( array( 'post_format' => $format, 'post_type' => $post->post_type ), 'edit.php' ) ) . '" class="post-state-format post-format-icon post-format-' . $format . '" title="' . $label . '">' . $label . ":</a> "; 668 668 } 669 669 670 if ( $can_edit_post && $post->post_status != 'trash') {670 if ( $can_edit_post ) { 671 671 echo '<a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $title ) ) . '">' . $pad . $title . '</a>'; 672 672 } else { 673 673 echo $pad . $title; … … 679 679 680 680 echo "</strong>\n"; 681 681 682 if ( $can_edit_post && $post->post_status != 'trash') {682 if ( $can_edit_post ) { 683 683 if ( $lock_holder ) { 684 684 $locked_avatar = get_avatar( $lock_holder->ID, 18 ); 685 685 $locked_text = esc_html( sprintf( __( '%s is currently editing' ), $lock_holder->display_name ) ); … … 694 694 the_excerpt(); 695 695 696 696 $actions = array(); 697 if ( $can_edit_post && 'trash' != $post->post_status) {697 if ( $can_edit_post ) { 698 698 $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID ) . '" title="' . esc_attr__( 'Edit this item' ) . '">' . __( 'Edit' ) . '</a>'; 699 699 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr__( 'Edit this item inline' ) . '">' . __( 'Quick Edit' ) . '</a>'; 700 700 } … … 714 714 $preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post ); 715 715 $actions['view'] = '<a href="' . esc_url( $preview_link ) . '" title="' . esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>'; 716 716 } 717 } else if ( 'trash' != $post->post_status ){717 } else { 718 718 $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>'; 719 719 } 720 720 } -
src/wp-admin/includes/meta-boxes.php
81 81 case 'pending': 82 82 _e('Pending Review'); 83 83 break; 84 case 'trash': 85 _e('Trash'); 86 break; 84 87 case 'draft': 85 88 case 'auto-draft': 86 89 _e('Draft'); … … 102 105 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option> 103 106 <?php endif; ?> 104 107 <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option> 108 <?php if ( 'trash' == $post->post_status ) : ?> 109 <option<?php selected( $post->post_status, 'trash' ); ?> value='trash'><?php _e('Trash') ?></option> 110 <?php endif; ?> 105 111 <?php if ( 'auto-draft' == $post->post_status ) : ?> 106 112 <option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php _e('Draft') ?></option> 107 113 <?php else : ?> … … 231 237 ?> 232 238 <div id="delete-action"> 233 239 <?php 234 if ( current_user_can( "delete_post", $post->ID ) ) {240 if ( current_user_can( "delete_post", $post->ID ) && 'trash' != $post->post_status ) { 235 241 if ( !EMPTY_TRASH_DAYS ) 236 242 $delete_text = __('Delete Permanently'); 237 243 else … … 244 250 <div id="publishing-action"> 245 251 <span class="spinner"></span> 246 252 <?php 247 if ( !in_array( $post->post_status, array('publish', 'future', 'private' ) ) || 0 == $post->ID ) {253 if ( !in_array( $post->post_status, array('publish', 'future', 'private', 'trash') ) || 0 == $post->ID ) { 248 254 if ( $can_publish ) : 249 255 if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?> 250 256 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Schedule') ?>" /> -
src/wp-admin/includes/post.php
1300 1300 } 1301 1301 1302 1302 if ( isset( $view_post ) ) { 1303 if( 'draft' == $post->post_status ) {1303 if( 'draft' == $post->post_status || 'trash' == $post->post_status ) { 1304 1304 $preview_link = set_url_scheme( get_permalink( $post->ID ) ); 1305 1305 /** This filter is documented in wp-admin/includes/meta-boxes.php */ 1306 1306 $preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post ); -
src/wp-admin/post.php
153 153 if ( ! current_user_can( 'edit_post', $post_id ) ) 154 154 wp_die( __( 'You are not allowed to edit this item.' ) ); 155 155 156 if ( 'trash' == $post->post_status )157 wp_die( __( 'You can’t edit this item because it is in the Trash. Please restore it and try again.' ) );158 159 156 if ( ! empty( $_GET['get-post-lock'] ) ) { 160 157 wp_set_post_lock( $post_id ); 161 158 wp_redirect( get_edit_post_link( $post_id, 'url' ) ); -
src/wp-includes/link-template.php
157 157 */ 158 158 $permalink = apply_filters( 'pre_post_link', $permalink, $post, $leavename ); 159 159 160 if ( '' != $permalink && !in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future' ) ) ) {160 if ( '' != $permalink && !in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future', 'trash' ) ) ) { 161 161 $unixtime = strtotime($post->post_date); 162 162 163 163 $category = ''; … … 253 253 254 254 $slug = $post->post_name; 255 255 256 $draft_or_pending = isset( $post->post_status ) && in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future' ) );256 $draft_or_pending = isset( $post->post_status ) && in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future', 'trash' ) ); 257 257 258 258 $post_type = get_post_type_object($post->post_type); 259 259 -
src/wp-includes/post.php
145 145 146 146 register_post_status( 'trash', array( 147 147 'label' => _x( 'Trash', 'post' ), 148 'internal' => true, 148 //'internal' => true, 149 'protected' => true, 149 150 '_builtin' => true, /* internal use only. */ 150 151 'label_count' => _n_noop( 'Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>' ), 151 152 'show_in_admin_status_list' => true,