Make WordPress Core

Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#2370 closed enhancement (fixed)

Small get_editable_authors function change: adding ORDER BY in the SQL

Reported by: paolo.gabrielli@… Owned by:
Milestone: Priority: lowest
Severity: normal Version: 2.0
Component: Administration Keywords: get_editable_authors display_name order has-patch
Focuses: Cc:


working with over 40 authors make me think that it's better to have that function (get_editable_authors()) ORDERing the result BY display_name because that field is the one in the select's output.
Doing so will result in a quicker author selection if you have a lot of authors, like I have.

Thank you,

Index: admin-db.php
--- admin-db.php        (revision 3503)
+++ admin-db.php        (working copy)
@@ -34,7 +34,7 @@
                return false;
        } else {
                $editable = join(',', $editable);
-               $authors = $wpdb->get_results( "SELECT * FROM $wpdb->users WHERE ID IN ($editable)" );
+               $authors = $wpdb->get_results( "SELECT * FROM $wpdb->users WHERE ID IN ($editable) ORDER BY display_name" );
        return apply_filters('get_editable_authors', $authors);

Attachments (1)

admin-db.patch.diff (502 bytes) - added by paolo.gabrielli@… 10 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 @davidhouse10 years ago

  • Keywords bg|has-patch added

comment:2 @Nazgul9 years ago

  • Keywords has-patch added; bg|has-patch removed
  • Milestone changed from 2.1 to 2.0.5

Candidate fo 2.0.5.

comment:3 @markjaquith9 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [4364]) Order get_editable_authors() by display_name. Props Paolo Gabrielli. fixes #2370

comment:4 @markjaquith9 years ago

(In [4365]) Order get_editable_authors() by display_name. Props Paolo Gabrielli. fixes #2370

comment:5 @anonymous9 years ago

  • Milestone 2.0.5 deleted

Milestone 2.0.5 deleted

Note: See TracTickets for help on using tickets.