X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/03f2fa83c13c1b532284205fa7efcab9b8b2c41f..784f914b1e4b1c62d6657e86397c2e83bcee4295:/wp-admin/includes/class-wp-media-list-table.php diff --git a/wp-admin/includes/class-wp-media-list-table.php b/wp-admin/includes/class-wp-media-list-table.php index 3e0f41cf..98deaac8 100644 --- a/wp-admin/includes/class-wp-media-list-table.php +++ b/wp-admin/includes/class-wp-media-list-table.php @@ -127,7 +127,7 @@ class WP_Media_List_Table extends WP_List_Table { $type_links['trash'] = sprintf( '', selected( 'trash' === $filter, true, false ), - __( 'Trash' ) + _x( 'Trash', 'attachment filter' ) ); } return $type_links; @@ -144,7 +144,7 @@ class WP_Media_List_Table extends WP_List_Table { $actions['untrash'] = __( 'Restore' ); $actions['delete'] = __( 'Delete Permanently' ); } else { - $actions['trash'] = __( 'Trash' ); + $actions['trash'] = _x( 'Trash', 'verb' ); } } else { $actions['delete'] = __( 'Delete Permanently' ); @@ -213,7 +213,7 @@ class WP_Media_List_Table extends WP_List_Table { * @access public */ public function no_items() { - _e( 'No media attachments found.' ); + _e( 'No media files found.' ); } /** @@ -370,23 +370,26 @@ class WP_Media_List_Table extends WP_List_Table { $link_start = $link_end = ''; if ( current_user_can( 'edit_post', $post->ID ) && ! $this->is_trash ) { - $link_start = ''; + $link_start = sprintf( + '', + get_edit_post_link( $post->ID ), + /* translators: %s: attachment title */ + esc_attr( sprintf( __( '“%s” (Edit)' ), $title ) ) + ); $link_end = ''; } $class = $thumb ? ' class="has-media-icon"' : ''; - ?> > - - + - - - - - - +
@@ -488,17 +491,27 @@ class WP_Media_List_Table extends WP_List_Table {
'parent_post_id' => $post->post_parent,
'media[]' => $post->ID,
'_wpnonce' => wp_create_nonce( 'bulk-' . $this->_args['plural'] )
- ), 'upload.php' ); ?>
-
- %s',
+ $detach_url,
+ /* translators: %s: title of the post the attachment is attached to */
+ esc_attr( sprintf( __( 'Detach from “%s”' ), $title ) ),
+ __( 'Detach' )
+ );
+ endif;
} else {
_e( '(Unattached)' ); ?>
-
-
- post_parent );
+ printf(
+ ' ',
+ $post->ID,
+ /* translators: %s: attachment title */
+ esc_attr( sprintf( __( 'Attach “%s” to existing content' ), $title ) ),
+ __( 'Attach' )
+ );
+ }
}
}
@@ -632,35 +645,102 @@ class WP_Media_List_Table extends WP_List_Table {
$actions = array();
if ( $this->detached ) {
- if ( current_user_can( 'edit_post', $post->ID ) )
- $actions['edit'] = '' . __( 'Edit' ) . '';
- if ( current_user_can( 'delete_post', $post->ID ) )
+ if ( current_user_can( 'edit_post', $post->ID ) ) {
+ $actions['edit'] = sprintf(
+ '%s',
+ get_edit_post_link( $post->ID ),
+ /* translators: %s: attachment title */
+ esc_attr( sprintf( __( 'Edit “%s”' ), $att_title ) ),
+ __( 'Edit' )
+ );
+ }
+ if ( current_user_can( 'delete_post', $post->ID ) ) {
if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
- $actions['trash'] = "ID ) . "'>" . __( 'Trash' ) . "";
+ $actions['trash'] = sprintf(
+ '%s',
+ wp_nonce_url( "post.php?action=trash&post=$post->ID", 'trash-post_' . $post->ID ),
+ /* translators: %s: attachment title */
+ esc_attr( sprintf( __( 'Move “%s” to the Trash' ), $att_title ) ),
+ _x( 'Trash', 'verb' )
+ );
} else {
- $delete_ays = !MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
- $actions['delete'] = "ID ) . "'>" . __( 'Delete Permanently' ) . "";
+ $delete_ays = ! MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
+ $actions['delete'] = sprintf(
+ '%s',
+ wp_nonce_url( "post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID ),
+ $delete_ays,
+ /* translators: %s: attachment title */
+ esc_attr( sprintf( __( 'Delete “%s” permanently' ), $att_title ) ),
+ __( 'Delete Permanently' )
+ );
}
- $actions['view'] = '' . __( 'View' ) . '';
- if ( current_user_can( 'edit_post', $post->ID ) )
- $actions['attach'] = ' ';
+ }
+ $actions['view'] = sprintf(
+ '%s',
+ get_permalink( $post->ID ),
+ /* translators: %s: attachment title */
+ esc_attr( sprintf( __( 'View “%s”' ), $att_title ) ),
+ __( 'View' )
+ );
+
+ if ( current_user_can( 'edit_post', $post->ID ) ) {
+ $actions['attach'] = sprintf(
+ ' ',
+ $post->ID,
+ /* translators: %s: attachment title */
+ esc_attr( sprintf( __( 'Attach “%s” to existing content' ), $att_title ) ),
+ __( 'Attach' )
+ );
+ }
}
else {
- if ( current_user_can( 'edit_post', $post->ID ) && !$this->is_trash )
- $actions['edit'] = '' . __( 'Edit' ) . '';
+ if ( current_user_can( 'edit_post', $post->ID ) && !$this->is_trash ) {
+ $actions['edit'] = sprintf(
+ '%s',
+ get_edit_post_link( $post->ID ),
+ /* translators: %s: attachment title */
+ esc_attr( sprintf( __( 'Edit “%s”' ), $att_title ) ),
+ __( 'Edit' )
+ );
+ }
if ( current_user_can( 'delete_post', $post->ID ) ) {
- if ( $this->is_trash )
- $actions['untrash'] = "ID ) . "'>" . __( 'Restore' ) . "";
- elseif ( EMPTY_TRASH_DAYS && MEDIA_TRASH )
- $actions['trash'] = "ID ) . "'>" . __( 'Trash' ) . "";
- if ( $this->is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH ) {
+ if ( $this->is_trash ) {
+ $actions['untrash'] = sprintf(
+ '%s',
+ wp_nonce_url( "post.php?action=untrash&post=$post->ID", 'untrash-post_' . $post->ID ),
+ /* translators: %s: attachment title */
+ esc_attr( sprintf( __( 'Restore “%s” from the Trash' ), $att_title ) ),
+ __( 'Restore' )
+ );
+ } elseif ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
+ $actions['trash'] = sprintf(
+ '%s',
+ wp_nonce_url( "post.php?action=trash&post=$post->ID", 'trash-post_' . $post->ID ),
+ /* translators: %s: attachment title */
+ esc_attr( sprintf( __( 'Move “%s” to the Trash' ), $att_title ) ),
+ _x( 'Trash', 'verb' )
+ );
+ }
+ if ( $this->is_trash || ! EMPTY_TRASH_DAYS || ! MEDIA_TRASH ) {
$delete_ays = ( !$this->is_trash && !MEDIA_TRASH ) ? " onclick='return showNotice.warn();'" : '';
- $actions['delete'] = "ID ) . "'>" . __( 'Delete Permanently' ) . "";
+ $actions['delete'] = sprintf(
+ '%s',
+ wp_nonce_url( "post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID ),
+ $delete_ays,
+ /* translators: %s: attachment title */
+ esc_attr( sprintf( __( 'Delete “%s” permanently' ), $att_title ) ),
+ __( 'Delete Permanently' )
+ );
}
}
- if ( !$this->is_trash ) {
- $title =_draft_or_post_title( $post->post_parent );
- $actions['view'] = '' . __( 'View' ) . '';
+ if ( ! $this->is_trash ) {
+ $actions['view'] = sprintf(
+ '%s',
+ get_permalink( $post->ID ),
+ /* translators: %s: attachment title */
+ esc_attr( sprintf( __( 'View “%s”' ), $att_title ) ),
+ __( 'View' )
+ );
}
}