WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#18144 closed enhancement (duplicate)

Update wp_nav_menu to support relative URLs

Reported by: parisholley Owned by:
Milestone: Priority: normal
Severity: minor Version: 3.2.1
Component: Template Keywords: has-patch
Focuses: Cc:

Description

in wp-includes/nav-menu-template.php add:

363: $relative_url = untrailingslashit($_SERVER['REQUEST_URI']);

modify the in_array check to add that as an option

if ( in_array( $item_url, array( $current_url, $_indexless_current, $relative_url ) ) ) 

I encourage clients to use relative url's so they can test with navigation across environments regardless of domains.

Attachments (1)

18144.patch (979 bytes) - added by SergeyBiryukov 3 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 nacin3 years ago

  • Keywords needs-patch added

No issues here.

SergeyBiryukov3 years ago

comment:2 SergeyBiryukov3 years ago

  • Keywords has-patch added; needs-patch removed

comment:4 WraithKenny3 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

comment:5 kawauso3 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.