You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28Lines changed: 28 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -204,6 +204,34 @@ To set a disabled link simply add `disabled` to the **CSS Classes** field in the
204
204
205
205
Headers, dividers and text only items can be added within dropdowns by adding a Custom Link and adding either `dropdown-header`, `dropdown-divider` or `dropdown-item-text` into the **CSS Classes** input. _Note: This will remove the `href` on the item and change it to either a `<span>` for headers or a `<div>` for dividers._
206
206
207
+
### Missing Edit Shortcut in Customizer Preview
208
+
209
+
According to the documentation for [`wp_nav_menu()`](https://developer.wordpress.org/reference/functions/wp_nav_menu/) one has to provide an instance of the custom walker class in order to apply the custom walker to the menu. As the instance is not [JSON serializable](https://make.wordpress.org/core/2015/07/29/fast-previewing-changes-to-menus-in-the-customizer/) this will cause the menu edit shortcut to not appear in the Customizer preview. To fix this do the following:
210
+
1. Provide the class name string instead of the class instance as value for the 'walker' key in the array of wp_nav_menu's arguments,
211
+
```diff
212
+
wp_nav_menu( array(
213
+
'theme_location' => 'primary',
214
+
'depth' => 2, // 1 = no dropdowns, 2 = with dropdowns.
0 commit comments