Making WordPress.org

Changeset 12990

Timestamp:
11/30/2023 10:37:12 PM (7 months ago)
Author:
coffee2code
Message:

Support Theme: Ensure menu link is marked as active if the link is for the current page, regardless of how the link was originally defined.

Props hiteshtalpada, coffee2code.
Fixes #7104.

File:
1 edited

Legend:

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

    r12369 r12990  
    5151                                <?php
    5252                                foreach ( $menu_items as $path => $text ) :
    53                                     $class = '';
    5453                                    $url = parse_url( $path );
     54
     55
     56
     57
     58
     59
     60
    5561                                    if ( ! empty( $url['host' ] ) ) {
    5662                                        $url = esc_url( $path );
    5763                                    } else {
    58                                         $class = false !== strpos( $_SERVER['REQUEST_URI'], $url['path'] ) ? 'class="active" ' : '';
    5964                                        $url = esc_url( home_url( $path ) );
    6065                                    }
Note: See TracChangeset for help on using the changeset viewer.