From 454d8682d0c9a9b5444d54700298175bc93c8207 Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Tue, 30 Jun 2015 22:30:19 +0000 Subject: [PATCH] Plugins list table: Sort plugins by `Name` by default so translated plugin names get correctly sorted. props swissspidy. fixes #32735. git-svn-id: https://develop.svn.wordpress.org/trunk@33010 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-plugins-list-table.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/wp-admin/includes/class-wp-plugins-list-table.php b/src/wp-admin/includes/class-wp-plugins-list-table.php index 9b12644585..51a216a788 100644 --- a/src/wp-admin/includes/class-wp-plugins-list-table.php +++ b/src/wp-admin/includes/class-wp-plugins-list-table.php @@ -199,13 +199,16 @@ class WP_Plugins_List_Table extends WP_List_Table { $total_this_page = $totals[ $status ]; - if ( $orderby ) { + if ( ! $orderby ) { + $orderby = 'Name'; + } else { $orderby = ucfirst( $orderby ); - $order = strtoupper( $order ); - - uasort( $this->items, array( $this, '_order_callback' ) ); } + $order = strtoupper( $order ); + + uasort( $this->items, array( $this, '_order_callback' ) ); + $plugins_per_page = $this->get_items_per_page( str_replace( '-', '_', $screen->id . '_per_page' ), 999 ); $start = ( $page - 1 ) * $plugins_per_page;