diff --git a/wp-includes/nav-menu-template.php b/wp-includes/nav-menu-template.php index 3c517d150f..737d6e6c2f 100644 --- a/wp-includes/nav-menu-template.php +++ b/wp-includes/nav-menu-template.php @@ -397,6 +397,11 @@ function _wp_menu_item_classes_by_context( &$menu_items ) { // if the menu item corresponds to the currently-requested URL } elseif ( 'custom' == $menu_item->object && isset( $_SERVER['HTTP_HOST'] ) ) { $_root_relative_current = untrailingslashit( $_SERVER['REQUEST_URI'] ); + + //if it is the customize page then it will strips the query var off the url before entering the comparison block. + if ( is_customize_preview() ) { + $_root_relative_current = strtok( untrailingslashit( $_SERVER['REQUEST_URI'] ), '?' ); + } $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_root_relative_current ); $raw_item_url = strpos( $menu_item->url, '#' ) ? substr( $menu_item->url, 0, strpos( $menu_item->url, '#' ) ) : $menu_item->url; $item_url = set_url_scheme( untrailingslashit( $raw_item_url ) ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 8f92441ca3..6e4d00731a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-40657'; +$wp_version = '4.8-alpha-40658'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.