Ticket #15791: 15791.v2.diff

File 15791.v2.diff, 2.2 KB (added by duck_, 2 years ago)
Line 
1Index: wp-includes/user.php
2===================================================================
3--- wp-includes/user.php        (revision 16888)
4+++ wp-includes/user.php        (working copy)
5@@ -412,7 +412,7 @@
6                // sorting
7                if ( in_array( $qv['orderby'], array('email', 'url', 'registered') ) ) {
8                        $orderby = 'user_' . $qv['orderby'];
9-               } elseif ( 'name' == $qv['orderby'] ) {
10+               } elseif ( 'name' == $qv['orderby'] || 'display_name' == $qv['orderby'] ) {
11                        $orderby = 'display_name';
12                } elseif ( 'post_count' == $qv['orderby'] ) {
13                        $where = get_posts_by_author_sql('post');
14@@ -928,15 +928,13 @@
15  * The available arguments are as follows:
16  * <ol>
17  * <li>show_option_all - Text to show all and whether HTML option exists.</li>
18- * <li>show_option_none - Text for show none and whether HTML option exists.
19- *     </li>
20- * <li>orderby - SQL order by clause for what order the users appear. Default is
21- * 'display_name'.</li>
22+ * <li>show_option_none - Text for show none and whether HTML option exists.</li>
23+ * <li>orderby - SQL order by clause for what order the users appear. Default is 'display_name'.</li>
24  * <li>order - Default is 'ASC'. Can also be 'DESC'.</li>
25  * <li>include - User IDs to include.</li>
26  * <li>exclude - User IDs to exclude.</li>
27  * <li>multi - Default is 'false'. Whether to skip the ID attribute on the 'select' element. A 'true' value is overridden when id argument is set.</li>
28- * <li>show - Default is 'display_name'. User table column to display. If the selected item is empty then the user_login will be displayed in parentesis</li>
29+ * <li>show - Default is 'display_name'. User table column to display. If the selected item is empty then the user_login will be displayed in parentheses</li>
30  * <li>echo - Default is '1'. Whether to display or retrieve content.</li>
31  * <li>selected - Which User ID is selected.</li>
32  * <li>name - Default is 'user'. Name attribute of select element.</li>
33@@ -967,7 +965,7 @@
34        $r = wp_parse_args( $args, $defaults );
35        extract( $r, EXTR_SKIP );
36 
37-       $users = get_users( wp_array_slice_assoc( $args, array( 'blog_id', 'include', 'exclude', 'orderby', 'order' ) ) );
38+       $users = get_users( wp_array_slice_assoc( $r, array( 'blog_id', 'include', 'exclude', 'orderby', 'order' ) ) );
39 
40        $output = '';
41        if ( !empty($users) ) {