X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/0459461f9ea42e0b090759ff6fe5f48360bef750..refs/tags/wordpress-4.5:/wp-admin/includes/class-wp-posts-list-table.php diff --git a/wp-admin/includes/class-wp-posts-list-table.php b/wp-admin/includes/class-wp-posts-list-table.php index d52ebc98..33eca44a 100644 --- a/wp-admin/includes/class-wp-posts-list-table.php +++ b/wp-admin/includes/class-wp-posts-list-table.php @@ -174,9 +174,9 @@ class WP_Posts_List_Table extends WP_List_Table { if ( ! empty( $_REQUEST['mode'] ) ) { $mode = $_REQUEST['mode'] === 'excerpt' ? 'excerpt' : 'list'; - set_user_setting ( 'posts_list_mode', $mode ); + set_user_setting( 'posts_list_mode', $mode ); } else { - $mode = get_user_setting ( 'posts_list_mode', 'list' ); + $mode = get_user_setting( 'posts_list_mode', 'list' ); } $this->is_trash = isset( $_REQUEST['post_status'] ) && $_REQUEST['post_status'] === 'trash'; @@ -426,7 +426,7 @@ class WP_Posts_List_Table extends WP_List_Table { if ( is_object_in_taxonomy( $this->screen->post_type, 'category' ) ) { $dropdown_options = array( - 'show_option_all' => __( 'All categories' ), + 'show_option_all' => get_taxonomy( 'category' )->labels->all_items, 'hide_empty' => 0, 'hierarchical' => 1, 'show_count' => 0, @@ -877,8 +877,14 @@ class WP_Posts_List_Table extends WP_List_Table { $title = _draft_or_post_title(); if ( $can_edit_post && $post->post_status != 'trash' ) { - $edit_link = get_edit_post_link( $post->ID ); - echo '' . $pad . $title . ''; + printf( + '%s%s', + get_edit_post_link( $post->ID ), + /* translators: %s: post title */ + esc_attr( sprintf( __( '“%s” (Edit)' ), $title ) ), + $pad, + $title + ); } else { echo $pad . $title; } @@ -1169,31 +1175,73 @@ class WP_Posts_List_Table extends WP_List_Table { $post_type_object = get_post_type_object( $post->post_type ); $can_edit_post = current_user_can( 'edit_post', $post->ID ); $actions = array(); + $title = _draft_or_post_title(); if ( $can_edit_post && 'trash' != $post->post_status ) { - $actions['edit'] = '' . __( 'Edit' ) . ''; - $actions['inline hide-if-no-js'] = '' . __( 'Quick Edit' ) . ''; + $actions['edit'] = sprintf( + '%s', + get_edit_post_link( $post->ID ), + /* translators: %s: post title */ + esc_attr( sprintf( __( 'Edit “%s”' ), $title ) ), + __( 'Edit' ) + ); + $actions['inline hide-if-no-js'] = sprintf( + '%s', + /* translators: %s: post title */ + esc_attr( sprintf( __( 'Quick edit “%s” inline' ), $title ) ), + __( 'Quick Edit' ) + ); } if ( current_user_can( 'delete_post', $post->ID ) ) { - if ( 'trash' === $post->post_status ) - $actions['untrash'] = "ID ) ), 'untrash-post_' . $post->ID ) . "'>" . __( 'Restore' ) . ""; - elseif ( EMPTY_TRASH_DAYS ) - $actions['trash'] = "" . __( 'Trash' ) . ""; - if ( 'trash' === $post->post_status || !EMPTY_TRASH_DAYS ) - $actions['delete'] = "" . __( 'Delete Permanently' ) . ""; + if ( 'trash' === $post->post_status ) { + $actions['untrash'] = sprintf( + '%s', + wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ), + /* translators: %s: post title */ + esc_attr( sprintf( __( 'Restore “%s” from the Trash' ), $title ) ), + __( 'Restore' ) + ); + } elseif ( EMPTY_TRASH_DAYS ) { + $actions['trash'] = sprintf( + '%s', + 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( + '%s', + 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 ) ) { - $title = _draft_or_post_title(); if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) { if ( $can_edit_post ) { - $unpublished_link = set_url_scheme( get_permalink( $post ) ); - $preview_link = get_preview_post_link( $post, array(), $unpublished_link ); - $actions['view'] = '' . __( 'Preview' ) . ''; + $preview_link = get_preview_post_link( $post ); + $actions['view'] = sprintf( + '%s', + esc_url( $preview_link ), + /* translators: %s: post title */ + esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ), + __( 'Preview' ) + ); } } elseif ( 'trash' != $post->post_status ) { - $actions['view'] = '' . __( 'View' ) . ''; + $actions['view'] = sprintf( + '%s', + get_permalink( $post->ID ), + /* translators: %s: post title */ + esc_attr( sprintf( __( 'View “%s”' ), $title ) ), + __( 'View' ) + ); } } @@ -1335,7 +1383,8 @@ class WP_Posts_List_Table extends WP_List_Table { 'name' => 'post_author', 'class'=> 'authors', 'multi' => 1, - 'echo' => 0 + 'echo' => 0, + 'show' => 'display_name_with_login', ); if ( $bulk ) $users_opt['show_option_none'] = __( '— No Change —' ); @@ -1355,7 +1404,7 @@ class WP_Posts_List_Table extends WP_List_Table { if ( !$bulk && $can_publish ) : ?> -
+