Changeset 11346
- Timestamp:
- 11/29/2021 05:33:48 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-consistency.php
r11345 r11346 169 169 } 170 170 171 // Group by translation . Done in PHP because it's faster as in MySQL.171 // Group by translation and project path. Done in PHP because it's faster as in MySQL. 172 172 usort( $results, [ $this, '_sort_callback' ] ); 173 173 … … 176 176 177 177 public function _sort_callback( $a, $b ) { 178 return strnatcmp( $a->translation, $b->translation ); 178 $sort = strnatcmp( $a->translation . $a->original_context, $b->translation . $b->original_context ); 179 if ( 0 === $sort ) { 180 $sort = strnatcmp( $a->project_path, $b->project_path ); 181 } 182 183 return $sort; 179 184 } 180 185 }
Note: See TracChangeset
for help on using the changeset viewer.