Avoid PHP notices in redirect_canonical() and _wp_menu_item_classes_by_context() if $_SERVER['HTTP_HOST'] is not set.
fixes #32229. Built from https://develop.svn.wordpress.org/trunk@33775 git-svn-id: http://core.svn.wordpress.org/trunk@33743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -553,7 +553,7 @@ function _wp_menu_item_classes_by_context( &$menu_items ) {
|
||||
$active_object = $menu_item->object;
|
||||
|
||||
// if the menu item corresponds to the currently-requested URL
|
||||
} elseif ( 'custom' == $menu_item->object ) {
|
||||
} elseif ( 'custom' == $menu_item->object && isset( $_SERVER['HTTP_HOST'] ) ) {
|
||||
$_root_relative_current = 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;
|
||||
|
||||
Reference in New Issue
Block a user