| 219 | | if ( current_user_can( 'delete_post', $post->ID ) ) { |
| 220 | | if ( 'trash' === $post->post_status ) { |
| 221 | | $actions['untrash'] = sprintf( |
| 222 | | '<a href="%s" aria-label="%s">%s</a>', |
| 223 | | wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ), |
| 224 | | /* translators: %s: post title */ |
| 225 | | esc_attr( sprintf( __( 'Restore “%s” from the Trash', 'wporg-plugins' ), $title ) ), |
| 226 | | __( 'Restore', 'wporg-plugins' ) |
| 227 | | ); |
| 228 | | } elseif ( EMPTY_TRASH_DAYS ) { |
| 229 | | $actions['trash'] = sprintf( |
| 230 | | '<a href="%s" class="submitdelete" aria-label="%s">%s</a>', |
| 231 | | get_delete_post_link( $post->ID ), |
| 232 | | /* translators: %s: post title */ |
| 233 | | esc_attr( sprintf( __( 'Move “%s” to the Trash', 'wporg-plugins' ), $title ) ), |
| 234 | | _x( 'Trash', 'verb', 'wporg-plugins' ) |
| 235 | | ); |
| 236 | | } |
| 237 | | if ( 'trash' === $post->post_status || ! EMPTY_TRASH_DAYS ) { |
| 238 | | $actions['delete'] = sprintf( |
| 239 | | '<a href="%s" class="submitdelete" aria-label="%s">%s</a>', |
| 240 | | get_delete_post_link( $post->ID, '', true ), |
| 241 | | /* translators: %s: post title */ |
| 242 | | esc_attr( sprintf( __( 'Delete “%s” permanently', 'wporg-plugins' ), $title ) ), |
| 243 | | __( 'Delete Permanently', 'wporg-plugins' ) |
| 244 | | ); |
| 245 | | } |
| 246 | | } |
| 247 | | |