Making WordPress.org

Changeset 5821


Ignore:
Timestamp:
08/17/2017 10:18:40 PM (7 years ago)
Author:
danielbachhuber
Message:

devhub/cli: Link section title back to commands

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php

    r5815 r5821  
    461461     */
    462462    function get_site_section_url() {
    463         $parts = explode( '/', $_SERVER['REQUEST_URI'] );
    464         switch ( $parts[1] ) {
     463        $parts = explode( '/', $GLOBALS['wp']->request );
     464        switch ( $parts[0] ) {
    465465            case 'reference':
    466466            case 'plugins':
    467467            case 'themes':
    468468                return home_url( '/' . $parts[1] . '/' );
     469            case 'cli':
     470                return home_url( '/cli/commands/' );
    469471            default:
    470472                return home_url( '/' );
Note: See TracChangeset for help on using the changeset viewer.