Make WordPress Core

Ticket #39758: 39758.2.patch

File 39758.2.patch, 1.0 KB (added by priyankabehera155, 9 years ago)
  • src/wp-includes/nav-menu-template.php

     
    397397                // if the menu item corresponds to the currently-requested URL
    398398                } elseif ( 'custom' == $menu_item->object && isset( $_SERVER['HTTP_HOST'] ) ) {
    399399                        $_root_relative_current = untrailingslashit( $_SERVER['REQUEST_URI'] );
     400
     401                        //if it is the customize page then it will strips the query var off the url before entering the comparison block.
     402                        if ( is_customize_preview() ) {
     403                                $_root_relative_current = strtok( untrailingslashit( $_SERVER['REQUEST_URI'] ), '?' );
     404                        }
    400405                        $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_root_relative_current );
    401406                        $raw_item_url = strpos( $menu_item->url, '#' ) ? substr( $menu_item->url, 0, strpos( $menu_item->url, '#' ) ) : $menu_item->url;
    402407                        $item_url = set_url_scheme( untrailingslashit( $raw_item_url ) );