{"id":24995,"date":"2016-09-06T22:53:59","date_gmt":"2016-09-06T21:53:59","guid":{"rendered":"https:\/\/www.megamenu.com\/documentation\/highlight-active-menu-items-copy\/"},"modified":"2016-09-06T22:57:12","modified_gmt":"2016-09-06T21:57:12","slug":"change-second-click-behaviour-for-single-location","status":"publish","type":"ht_kb","link":"https:\/\/www.megamenu.com\/documentation\/change-second-click-behaviour-for-single-location\/","title":{"rendered":"How to change the &#8216;Second Click Behaviour&#8217; option for a single location"},"content":{"rendered":"<p>The &#8216;Second Click Behaviour&#8217; option is a global setting and will apply to all of your Max Mega Menu enabled menus.<\/p>\n<p>To change the &#8216;Second Click Behaviour&#8217; option for a single menu location, add the following to your themes functions.php file:<\/p>\n<pre class=\"lang:default decode:true\">function megamenu_second_click_one_menu_location_only($attributes, $menu_id, $menu_settings, $settings, $current_theme_location) {\r\n     \/\/ change 'primary' to the ID of your menu location\r\n     if ($current_theme_location == 'primary') {\r\n         $attributes['data-second-click'] = 'go'; \/\/ either 'go' or 'close'\r\n     }\r\n     return $attributes;\r\n}\r\nadd_filter('megamenu_wrap_attributes', 'megamenu_second_click_one_menu_location_only', 10, 5);<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The &#8216;Second Click Behaviour&#8217; option is a global setting and will apply to all of your Max Mega Menu enabled menus. To change the &#8216;Second Click Behaviour&#8217; option for a single menu location, add the following to your themes functions.php file: function megamenu_second_click_one_menu_location_only($attributes, $menu_id, $menu_settings, $settings, $current_theme_location) { \/\/ change&#8230;<\/p>\n","protected":false},"author":1,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"ht-kb-category":[14],"ht-kb-tag":[],"class_list":["post-24995","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-faqs"],"uagb_featured_image_src":[],"uagb_author_info":{"display_name":"Tom Hemsley","author_link":"https:\/\/www.megamenu.com\/author\/megamenu\/"},"uagb_comment_info":0,"uagb_excerpt":"The &#8216;Second Click Behaviour&#8217; option is a global setting and will apply to all of your Max Mega Menu enabled menus. To change the &#8216;Second Click Behaviour&#8217; option for a single menu location, add the following to your themes functions.php file: function megamenu_second_click_one_menu_location_only($attributes, $menu_id, $menu_settings, $settings, $current_theme_location) { \/\/ change...","_links":{"self":[{"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb\/24995","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/comments?post=24995"}],"version-history":[{"count":2,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb\/24995\/revisions"}],"predecessor-version":[{"id":24997,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb\/24995\/revisions\/24997"}],"wp:attachment":[{"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/media?parent=24995"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb-category?post=24995"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb-tag?post=24995"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}