- ?></td>
- <?php
- break;
-
- default:
- if ( 'categories' == $column_name )
- $taxonomy = 'category';
- elseif ( 'tags' == $column_name )
- $taxonomy = 'post_tag';
- elseif ( 0 === strpos( $column_name, 'taxonomy-' ) )
- $taxonomy = substr( $column_name, 9 );
- else
- $taxonomy = false;
-
- if ( $taxonomy ) {
- $taxonomy_object = get_taxonomy( $taxonomy );
- echo '<td ' . $attributes . '>';
- if ( $terms = get_the_terms( $post->ID, $taxonomy ) ) {
- $out = array();
- foreach ( $terms as $t ) {
- $posts_in_term_qv = array();
- if ( 'post' != $post->post_type )
- $posts_in_term_qv['post_type'] = $post->post_type;
- if ( $taxonomy_object->query_var ) {
- $posts_in_term_qv[ $taxonomy_object->query_var ] = $t->slug;
- } else {
- $posts_in_term_qv['taxonomy'] = $taxonomy;
- $posts_in_term_qv['term'] = $t->slug;
- }
-
- $out[] = sprintf( '<a href="%s">%s</a>',
- esc_url( add_query_arg( $posts_in_term_qv, 'edit.php' ) ),
- esc_html( sanitize_term_field( 'name', $t->name, $t->term_id, $taxonomy, 'display' ) )
- );
- }
- /* translators: used between list items, there is a space after the comma */
- echo join( __( ', ' ), $out );
- } else {
- echo '—';
- }
- echo '</td>';
- break;
+ } elseif ( EMPTY_TRASH_DAYS ) {
+ $actions['trash'] = sprintf(
+ '<a href="%s" class="submitdelete" aria-label="%s">%s</a>',
+ get_delete_post_link( $post->ID ),
+ /* translators: %s: post title */
+ esc_attr( sprintf( __( 'Move “%s” to the Trash' ), $title ) ),
+ _x( 'Trash', 'verb' )
+ );
+ }
+ if ( 'trash' === $post->post_status || ! EMPTY_TRASH_DAYS ) {
+ $actions['delete'] = sprintf(
+ '<a href="%s" class="submitdelete" aria-label="%s">%s</a>',
+ get_delete_post_link( $post->ID, '', true ),
+ /* translators: %s: post title */
+ esc_attr( sprintf( __( 'Delete “%s” permanently' ), $title ) ),
+ __( 'Delete Permanently' )
+ );
+ }
+ }
+
+ if ( is_post_type_viewable( $post_type_object ) ) {
+ if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) {
+ if ( $can_edit_post ) {
+ $preview_link = get_preview_post_link( $post );
+ $actions['view'] = sprintf(
+ '<a href="%s" rel="permalink" aria-label="%s">%s</a>',
+ esc_url( $preview_link ),
+ /* translators: %s: post title */
+ esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ),
+ __( 'Preview' )
+ );