WordPress.org

Making WordPress.org

Changeset 4846


Ignore:
Timestamp:
01/31/2017 11:54:44 PM (2 years ago)
Author:
coffee2code
Message:

Support Theme: Link "Forums" in menu to "/#bbpress-forums".

It now more aptly leads to actual forums listing and no longer duplicates the link target of the preceding "Support" link.

Fixes #2455.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/header.php

    r4845 r4846  
    1414$menu_items = array(
    1515    /* translators: relative link to the forums home page */
    16     _x( '/', 'header menu', 'wporg-forums' )                                            => _x( 'Forums', 'header menu', 'wporg-forums' ),
     16    _x( '/#bbpress-forums', 'header menu', 'wporg-forums' )                             => _x( 'Forums', 'header menu', 'wporg-forums' ),
    1717    _x( 'https://codex.wordpress.org/Main_Page', 'header menu', 'wporg-forums' )        => _x( 'Documentation', 'header menu', 'wporg-forums' ),
    1818    _x( 'https://make.wordpress.org/support/handbook/', 'header menu', 'wporg-forums' ) => _x( 'Get Involved', 'header menu', 'wporg-forums' ),
     
    4747                                <?php
    4848                                foreach ( $menu_items as $path => $text ) :
    49                                     $class = false !== strpos( $_SERVER['REQUEST_URI'], $path ) ? 'class="active" ' : '';
     49                                    $class = '';
    5050                                    $url = parse_url( $path );
    5151                                    if ( ! empty( $url['host' ] ) ) {
    5252                                        $url = esc_url( $path );
    5353                                    } else {
     54                                        $class = false !== strpos( $_SERVER['REQUEST_URI'], $url['path'] ) ? 'class="active" ' : '';
    5455                                        $url = esc_url( home_url( $path ) );
    5556                                    }
Note: See TracChangeset for help on using the changeset viewer.