Changeset 48151 for trunk/src/wp-admin/includes/class-wp-list-table.php
- Timestamp:
- 06/23/2020 11:13:35 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-list-table.php
r48134 r48151 947 947 948 948 /** 949 * Get a list of sortable columns. The format is:950 * 'internal-name' => 'orderby'951 * or952 * 'internal-name' => array( 'orderby', true )953 * 954 * The second format will make the initial sorting order be descending949 * Get a list of sortable columns. 950 * 951 * The format is: 952 * - `'internal-name' => 'orderby'` 953 * - `'internal-name' => array( 'orderby', 'asc' )` - The second element set the initial sorting order. 954 * - `'internal-name' => array( 'orderby', true )` - The second element will make the initial sorting order be descending. 955 955 * 956 956 * @since 3.1.0 … … 1162 1162 $class[] = $current_order; 1163 1163 } else { 1164 $order = $desc_first ? 'desc' : 'asc'; 1164 if ( in_array( strtolower( $desc_first ), array( 'desc', 'asc' ), true ) ) { 1165 $order = 'asc' === strtolower( $desc_first ) ? 'desc' : 'asc'; 1166 } else { 1167 $order = $desc_first ? 'desc' : 'asc'; 1168 } 1165 1169 $class[] = 'sortable'; 1166 $class[] = $desc_first? 'asc' : 'desc';1170 $class[] = 'desc' === $order ? 'asc' : 'desc'; 1167 1171 } 1168 1172
Note: See TracChangeset
for help on using the changeset viewer.