Changeset 12990
- Timestamp:
- 11/30/2023 10:37:12 PM (13 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/header.php
r12369 r12990 51 51 <?php 52 52 foreach ( $menu_items as $path => $text ) : 53 $class = '';54 53 $url = parse_url( $path ); 54 55 // Check both host and path (if available). 56 $is_same_host = ! empty( $url['host'] ) ? $url['host'] === $_SERVER['HTTP_HOST'] : true; 57 $is_same_path = ! empty( $url['path'] ) && false !== strpos( $_SERVER['REQUEST_URI'], $url['path'] ); 58 59 $class = ( $is_same_host && $is_same_path ) ? 'class="active" ' : ''; 60 55 61 if ( ! empty( $url['host' ] ) ) { 56 62 $url = esc_url( $path ); 57 63 } else { 58 $class = false !== strpos( $_SERVER['REQUEST_URI'], $url['path'] ) ? 'class="active" ' : '';59 64 $url = esc_url( home_url( $path ) ); 60 65 }
Note: See TracChangeset
for help on using the changeset viewer.