- Timestamp:
- 01/17/2016 03:46:01 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-posts-list-table.php
r35901 r36333 878 878 879 879 if ( $can_edit_post && $post->post_status != 'trash' ) { 880 $edit_link = get_edit_post_link( $post->ID ); 881 echo '<a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $title ) ) . '">' . $pad . $title . '</a>'; 880 printf( 881 '<a class="row-title" href="%s" aria-label="%s">%s%s</a>', 882 get_edit_post_link( $post->ID ), 883 /* translators: %s: post title */ 884 esc_attr( sprintf( __( '“%s” (Edit)' ), $title ) ), 885 $pad, 886 $title 887 ); 882 888 } else { 883 889 echo $pad . $title; … … 1170 1176 $can_edit_post = current_user_can( 'edit_post', $post->ID ); 1171 1177 $actions = array(); 1178 $title = _draft_or_post_title(); 1172 1179 1173 1180 if ( $can_edit_post && 'trash' != $post->post_status ) { 1174 $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID ) . '" title="' . esc_attr__( 'Edit this item' ) . '">' . __( 'Edit' ) . '</a>'; 1175 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr__( 'Edit this item inline' ) . '">' . __( 'Quick Edit' ) . '</a>'; 1181 $actions['edit'] = sprintf( 1182 '<a href="%s" aria-label="%s">%s</a>', 1183 get_edit_post_link( $post->ID ), 1184 /* translators: %s: post title */ 1185 esc_attr( sprintf( __( 'Edit “%s”' ), $title ) ), 1186 __( 'Edit' ) 1187 ); 1188 $actions['inline hide-if-no-js'] = sprintf( 1189 '<a href="#" class="editinline" aria-label="%s">%s</a>', 1190 /* translators: %s: post title */ 1191 esc_attr( sprintf( __( 'Quick edit “%s” inline' ), $title ) ), 1192 __( 'Quick Edit' ) 1193 ); 1176 1194 } 1177 1195 1178 1196 if ( current_user_can( 'delete_post', $post->ID ) ) { 1179 if ( 'trash' === $post->post_status ) 1180 $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash' ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>"; 1181 elseif ( EMPTY_TRASH_DAYS ) 1182 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash' ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . _x( 'Trash', 'verb' ) . "</a>"; 1183 if ( 'trash' === $post->post_status || !EMPTY_TRASH_DAYS ) 1184 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently' ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>"; 1197 if ( 'trash' === $post->post_status ) { 1198 $actions['untrash'] = sprintf( 1199 '<a href="%s" aria-label="%s">%s</a>', 1200 wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ), 1201 /* translators: %s: post title */ 1202 esc_attr__( sprintf( __( 'Restore “%s” from the Trash' ), $title ) ), 1203 __( 'Restore' ) 1204 ); 1205 } elseif ( EMPTY_TRASH_DAYS ) { 1206 $actions['trash'] = sprintf( 1207 '<a href="%s" class="submitdelete" aria-label="%s">%s</a>', 1208 get_delete_post_link( $post->ID ), 1209 /* translators: %s: post title */ 1210 esc_attr__( sprintf( __( 'Move “%s” to the Trash' ), $title ) ), 1211 _x( 'Trash', 'verb' ) 1212 ); 1213 } 1214 if ( 'trash' === $post->post_status || ! EMPTY_TRASH_DAYS ) { 1215 $actions['delete'] = sprintf( 1216 '<a href="%s" class="submitdelete" aria-label="%s">%s</a>', 1217 get_delete_post_link( $post->ID, '', true ), 1218 /* translators: %s: post title */ 1219 esc_attr__( sprintf( __( 'Delete “%s” permanently' ), $title ) ), 1220 __( 'Delete Permanently' ) 1221 ); 1222 } 1185 1223 } 1186 1224 1187 1225 if ( is_post_type_viewable( $post_type_object ) ) { 1188 $title = _draft_or_post_title();1189 1226 if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) { 1190 1227 if ( $can_edit_post ) { 1191 1228 $unpublished_link = set_url_scheme( get_permalink( $post ) ); 1192 1229 $preview_link = get_preview_post_link( $post, array(), $unpublished_link ); 1193 $actions['view'] = '<a href="' . esc_url( $preview_link ) . '" title="' . esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>'; 1230 $actions['view'] = sprintf( 1231 '<a href="%s" rel="permalink" aria-label="%s">%s</a>', 1232 esc_url( $preview_link ), 1233 /* translators: %s: post title */ 1234 esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ), 1235 __( 'Preview' ) 1236 ); 1194 1237 } 1195 1238 } elseif ( 'trash' != $post->post_status ) { 1196 $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>'; 1239 $actions['view'] = sprintf( 1240 '<a href="%s" rel="permalink" aria-label="%s">%s</a>', 1241 get_permalink( $post->ID ), 1242 /* translators: %s: post title */ 1243 esc_attr( sprintf( __( 'View “%s”' ), $title ) ), 1244 __( 'View' ) 1245 ); 1197 1246 } 1198 1247 }
Note: See TracChangeset
for help on using the changeset viewer.