Cast menu walker object ids to int to compare dropdown thumbnails
authorLaury GvR <laury@gaslightmedia.com>
Tue, 7 May 2019 20:20:26 +0000 (16:20 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Tue, 7 May 2019 20:20:26 +0000 (16:20 -0400)
lib/menu-walker.php

index 19d6096..c3cced9 100644 (file)
@@ -112,7 +112,7 @@ class Glm_Theme_Top_Bar_Walker extends Walker_Nav_Menu {
             background-size: cover;
             </style>";
 
-        } else if( $depth !== 0 && 1410 == $object->object_id ){
+        } else if( $depth !== 0 && 1410 == (int)$object->object_id ){
             $thumbnail = get_template_directory_uri() . '/assets/run-mackinac.jpg';
             $item_style .= "<style>
             #menu-main #menu-item-".$object->ID.":before {
@@ -123,8 +123,8 @@ class Glm_Theme_Top_Bar_Walker extends Walker_Nav_Menu {
             background-image: url('".$thumbnail."');
             background-size: cover;
             </style>";
-            
-        } else if( $depth !== 0 && 1433 == $object->object_id ){
+
+        } else if( $depth !== 0 && 1433 == (int)$object->object_id ){
             $thumbnail = get_template_directory_uri() . '/assets/chicago-yacht-race.jpg';
             $item_style .= "<style>
             #menu-main #menu-item-".$object->ID.":before {