Making WordPress.org

Changeset 11092


Ignore:
Timestamp:
07/05/2021 05:52:38 PM (4 years ago)
Author:
ocean90
Message:

Translate: Use a fixed order for top-level project navigation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-locale.php

    r9616 r11092  
    6161        // Grab the top level projects to show in the menu first, so as to be able to handle the default Waiting / WP tab selection
    6262        $top_level_projects = $this->get_active_top_level_projects();
    63         usort( $top_level_projects, array( $this, '_sort_reverse_name_callback' ) );
    6463
    6564        // Default to the Waiting or WordPress tabs
     
    968967                parent_project_id IS NULL
    969968                AND active = 1
    970             ORDER BY name ASC
     969            ORDER BY FIELD( slug, 'waiting', 'wp', 'wp-themes', 'wp-plugins', 'patterns', 'meta', 'apps' )
    971970        " );
    972     }
    973 
    974     private function _sort_reverse_name_callback( $a, $b ) {
    975         // The Waiting project should always be first.
    976         if ( $a->slug == 'waiting' ) {
    977             return -1;
    978         }
    979         return - strcasecmp( $a->name, $b->name );
    980971    }
    981972
Note: See TracChangeset for help on using the changeset viewer.