1+
12window . _wpCustomizeNavMenusSettings = {
23 'nonce' : 'yo' ,
34 'phpIntMax' : '2147483647' ,
45 'menuItemTransport' : 'postMessage' ,
56 'allMenus' : [ {
67 'term_id' : '2' ,
7- 'name' : 'Awesome menu ' ,
8- 'slug' : 'awesome -menu' ,
8+ 'name' : 'Social Menu ' ,
9+ 'slug' : 'social -menu' ,
910 'term_group' : '0' ,
1011 'term_taxonomy_id' : '2' ,
1112 'taxonomy' : 'nav_menu' ,
@@ -14,8 +15,8 @@ window._wpCustomizeNavMenusSettings = {
1415 'count' : '0'
1516 } , {
1617 'term_id' : '3' ,
17- 'name' : 'Cool Menu' ,
18- 'slug' : 'cool -menu' ,
18+ 'name' : 'Primary Menu' ,
19+ 'slug' : 'primary -menu' ,
1920 'term_group' : '0' ,
2021 'term_taxonomy_id' : '3' ,
2122 'taxonomy' : 'nav_menu' ,
@@ -48,27 +49,33 @@ window._wpCustomizeNavMenusSettings = {
4849 'nav_menu_term_id' : 0
4950 }
5051 } ,
51- 'itemTypes' : {
52- 'postTypes' : {
53- 'page' : {
54- 'label' : 'Page'
55- } ,
56- 'post' : {
57- 'label' : 'Post'
58- }
52+ 'itemTypes' : [
53+ {
54+ 'title' : 'Post' ,
55+ 'type' : 'post_type' ,
56+ 'object' : 'post'
57+ } ,
58+ {
59+ 'title' : 'Page' ,
60+ 'type' : 'post_type' ,
61+ 'object' : 'page'
62+ } ,
63+ {
64+ 'title' : 'Category' ,
65+ 'type' : 'taxonomy' ,
66+ 'object' : 'category'
67+ } ,
68+ {
69+ 'title' : 'Tag' ,
70+ 'type' : 'taxonomy' ,
71+ 'object' : 'post_tag'
5972 } ,
60- 'taxonomies' : {
61- 'post_tag' : {
62- 'label' : 'Tag'
63- } ,
64- 'post_format' : {
65- 'label' : 'Format'
66- } ,
67- 'category' : {
68- 'label' : 'Category'
69- }
73+ {
74+ 'title' : 'Format' ,
75+ 'type' : 'taxonomy' ,
76+ 'object' : 'post_format'
7077 }
71- } ,
78+ ] ,
7279 'l10n' : {
7380 'custom_label' : 'Custom Link' ,
7481 'customizingMenus' : 'Customizing ▸ Menus' ,
@@ -97,7 +104,6 @@ window._wpCustomizeNavMenusSettings = {
97104 'untitled' : '(no label)'
98105 }
99106} ;
100-
101107window . _wpCustomizeSettings . panels . nav_menus = {
102108 'id' : 'nav_menus' ,
103109 'description' : '<p>This panel is used for managing navigation menus for content you have already published on your site. You can create menus and add items for existing content such as pages, posts, categories, tags, formats, or custom links.</p><p>Menus can be displayed in locations defined by your theme or in <a href="javascript:wp.customize.panel( "widgets" ).focus();">widget areas</a> by adding a “Custom Menu” widget.</p>' ,
@@ -109,6 +115,288 @@ window._wpCustomizeSettings.panels.nav_menus = {
109115 'instanceNumber' : 2
110116} ;
111117
118+ // Nav Menu Locations
119+ window . _wpCustomizeSettings . sections . menu_locations = {
120+ 'id' : 'menu_locations' ,
121+ 'description' : '<p>Your theme contains 1 menu location. Select which menu you would like to use.<\/p><p>You can also place menus in widget areas with the Custom Menu widget.<\/p>' ,
122+ 'priority' : 5 ,
123+ 'panel' : 'nav_menus' ,
124+ 'type' : 'default' ,
125+ 'title' : 'Menu Locations' ,
126+ 'content' : '' ,
127+ 'active' : true ,
128+ 'instanceNumber' : 13 ,
129+ 'customizeAction' : 'Customizing ▸ Menus'
130+ } ;
131+ window . _wpCustomizeSettings . settings [ 'nav_menu_locations[social]' ] = {
132+ 'value' : 2 ,
133+ 'transport' : 'postMessage' ,
134+ 'dirty' : false
135+ } ;
136+ window . _wpCustomizeSettings . controls [ 'nav_menu_locations[social]' ] = {
137+ 'settings' : { 'default' : 'nav_menu_locations[social]' } ,
138+ 'type' : 'nav_menu_location' ,
139+ 'priority' : 10 ,
140+ 'active' : true ,
141+ 'section' : 'menu_locations' ,
142+ 'content' : '<li id="customize-control-nav_menu_locations-social" class="customize-control customize-control-nav_menu_location"> <label> <span class="customize-control-title">Social Links Menu</span> <select data-customize-setting-link="nav_menu_locations[social]"> <option value="0">— Select —</option><option value="59">Prim</option><option value="60" selected="selected">Social</option><option value="61">test11</option><option value="62">test222</option><option value="63">test333</option> </select> </label> </li>' ,
143+ 'label' : 'Social Links Menu' ,
144+ 'description' : '' ,
145+ 'instanceNumber' : 40 ,
146+ 'locationId' : 'social'
147+ } ;
148+ window . _wpCustomizeSettings . settings [ 'nav_menu_locations[primary]' ] = {
149+ 'value' : 3 ,
150+ 'transport' : 'postMessage' ,
151+ 'dirty' : false
152+ } ;
153+ window . _wpCustomizeSettings . controls [ 'nav_menu_locations[primary]' ] = {
154+ 'active' : true ,
155+ 'content' : '<li id="customize-control-nav_menu_locations-primary" class="customize-control customize-control-nav_menu_location"> <label> <span class="customize-control-title">Primary Menu</span> <select data-customize-setting-link="nav_menu_locations[primary]"> <option value="0">— Select —</option><option value="59" selected="selected">Prim</option><option value="60">Social</option><option value="61">test11</option><option value="62">test222</option><option value="63">test333</option> </select> </label> </li>' ,
156+ 'description' : '' ,
157+ 'instanceNumber' : 39 ,
158+ 'label' : 'Primary Menu' ,
159+ 'locationId' : 'primary' ,
160+ 'priority' : 10 ,
161+ 'section' : 'menu_locations' ,
162+ 'settings' : {
163+ 'default' : 'nav_menu_locations[primary]'
164+ } ,
165+ 'type' : 'nav_menu_location'
166+ } ;
167+
168+ // Nav Menus
169+ window . _wpCustomizeSettings . sections [ 'nav_menu[3]' ] = {
170+ 'id' : 'nav_menu[3]' ,
171+ 'description' : '' ,
172+ 'priority' : 10 ,
173+ 'panel' : 'nav_menus' ,
174+ 'type' : 'nav_menu' ,
175+ 'title' : 'Primary Menu' ,
176+ 'content' : '' ,
177+ 'active' : true ,
178+ 'instanceNumber' : 15 ,
179+ 'customizeAction' : 'Customizing ▸ Menus' ,
180+ 'menu_id' : 3
181+ } ;
182+ window . _wpCustomizeSettings . settings [ 'nav_menu[3]' ] = {
183+ 'value' : {
184+ 'name' : 'Primary menu' ,
185+ 'description' : '' ,
186+ 'parent' : 0 ,
187+ 'auto_add' : false
188+ } ,
189+ 'transport' : 'postMessage' ,
190+ 'dirty' : false
191+ } ;
192+
193+ window . _wpCustomizeSettings . sections [ 'nav_menu[2]' ] = {
194+ 'id' : 'nav_menu[2]' ,
195+ 'description' : '' ,
196+ 'priority' : 10 ,
197+ 'panel' : 'nav_menus' ,
198+ 'type' : 'nav_menu' ,
199+ 'title' : 'Social menu' ,
200+ 'content' : '' ,
201+ 'active' : true ,
202+ 'instanceNumber' : 14 ,
203+ 'customizeAction' : 'Customizing ▸ Menus' ,
204+ 'menu_id' : 2
205+ } ;
206+ window . _wpCustomizeSettings . settings [ 'nav_menu[2]' ] = {
207+ 'value' : {
208+ 'name' : 'Social menu' ,
209+ 'description' : '' ,
210+ 'parent' : 0 ,
211+ 'auto_add' : false
212+ } ,
213+ 'transport' : 'postMessage' ,
214+ 'dirty' : false
215+ } ;
216+
217+ // Menu items
218+ window . _wpCustomizeSettings . settings [ 'nav_menu_item[2000]' ] = {
219+ 'dirty' : false ,
220+ 'transport' : 'postMessage' ,
221+ 'value' : {
222+ 'attr_title' : '' ,
223+ 'classes' : [
224+ ''
225+ ] ,
226+ 'description' : '' ,
227+ 'menu_item_parent' : 0 ,
228+ 'nav_menu_term_id' : 3 ,
229+ 'object' : 'page' ,
230+ 'object_id' : 2 ,
231+ 'original_title' : 'Sample Page' ,
232+ 'position' : 1 ,
233+ 'status' : 'publish' ,
234+ 'target' : '' ,
235+ 'title' : 'Sample Page' ,
236+ 'type' : 'post_type' ,
237+ 'type_label' : 'Page' ,
238+ 'url' : 'http://src.wordpress-develop.dev/sample-page/' ,
239+ 'xfn' : ''
240+ }
241+ } ;
242+ window . _wpCustomizeSettings . controls [ 'nav_menu_item[2000]' ] = {
243+ 'active' : true ,
244+ 'attr_title' : '' ,
245+ 'classes' : '' ,
246+ 'content' : '<li id="customize-control-nav_menu_item-2000" class="customize-control customize-control-nav_menu_item"> </li>' ,
247+ 'depth' : 0 ,
248+ 'description' : '' ,
249+ 'el_classes' : 'menu-item menu-item-depth-0 menu-item-page menu-item-edit-inactive' ,
250+ 'instanceNumber' : 42 ,
251+ 'item_type' : 'post_type' ,
252+ 'item_type_label' : 'Page' ,
253+ 'label' : 'Sample Page' ,
254+ 'menu_item_id' : 2000 ,
255+ 'original_title' : 'Sample Page' ,
256+ 'parent' : 0 ,
257+ 'priority' : 1 ,
258+ 'section' : 'nav_menu[3]' ,
259+ 'settings' : {
260+ 'default' : 'nav_menu_item[2000]'
261+ } ,
262+ 'target' : '' ,
263+ 'title' : 'Sample Page' ,
264+ 'type' : 'nav_menu_item' ,
265+ 'url' : 'http://src.wordpress-develop.dev/sample-page/' ,
266+ 'xfn' : ''
267+ } ;
268+
269+ window . _wpCustomizeSettings . settings [ 'nav_menu_item[2001]' ] = {
270+ 'dirty' : false ,
271+ 'transport' : 'postMessage' ,
272+ 'value' : {
273+ 'attr_title' : '' ,
274+ 'classes' : [
275+ ''
276+ ] ,
277+ 'description' : '' ,
278+ 'menu_item_parent' : 0 ,
279+ 'nav_menu_term_id' : 3 ,
280+ 'object' : 'custom' ,
281+ 'object_id' : 2001 ,
282+ 'original_title' : '' ,
283+ 'position' : 2 ,
284+ 'status' : 'publish' ,
285+ 'target' : '' ,
286+ 'title' : 'Example' ,
287+ 'type' : 'custom' ,
288+ 'type_label' : 'Custom Link' ,
289+ 'url' : 'http://example.com/' ,
290+ 'xfn' : ''
291+ }
292+ } ;
293+ window . _wpCustomizeSettings . controls [ 'nav_menu_item[2001]' ] = {
294+ 'active' : true ,
295+ 'attr_title' : '' ,
296+ 'classes' : '' ,
297+ 'content' : '<li id="customize-control-nav_menu_item-2001" class="customize-control customize-control-nav_menu_item"> </li>' ,
298+ 'depth' : 0 ,
299+ 'description' : '' ,
300+ 'el_classes' : 'menu-item menu-item-depth-0 menu-item-custom menu-item-edit-inactive' ,
301+ 'instanceNumber' : 46 ,
302+ 'item_type' : 'custom' ,
303+ 'item_type_label' : 'Custom Link' ,
304+ 'label' : 'Example' ,
305+ 'menu_item_id' : 2001 ,
306+ 'original_title' : '' ,
307+ 'parent' : 0 ,
308+ 'priority' : 2 ,
309+ 'section' : 'nav_menu[3]' ,
310+ 'settings' : {
311+ 'default' : 'nav_menu_item[2001]'
312+ } ,
313+ 'target' : '' ,
314+ 'title' : 'Example' ,
315+ 'type' : 'nav_menu_item' ,
316+ 'url' : 'http://example.com/' ,
317+ 'xfn' : ''
318+ } ;
319+
320+ window . _wpCustomizeSettings . settings [ 'nav_menu_item[2002]' ] = {
321+ 'dirty' : false ,
322+ 'transport' : 'postMessage' ,
323+ 'value' : {
324+ 'attr_title' : '' ,
325+ 'classes' : '' ,
326+ 'description' : '' ,
327+ 'menu_item_parent' : 2001 ,
328+ 'nav_menu_term_id' : 3 ,
329+ 'object' : '' ,
330+ 'object_id' : 0 ,
331+ 'original_title' : 'Sub-Example' ,
332+ 'position' : 3 ,
333+ 'status' : 'publish' ,
334+ 'target' : '' ,
335+ 'title' : 'Example' ,
336+ 'type' : 'custom' ,
337+ 'type_label' : 'Custom Link' ,
338+ 'url' : 'http://sub.example.com/' ,
339+ 'xfn' : ''
340+ }
341+ } ;
342+ window . _wpCustomizeSettings . controls [ 'nav_menu_item[2002]' ] = {
343+ 'active' : true ,
344+ 'attr_title' : '' ,
345+ 'classes' : '' ,
346+ 'content' : '<li id="customize-control-nav_menu_item-2002" class="customize-control customize-control-nav_menu_item"> </li>' ,
347+ 'depth' : 0 ,
348+ 'description' : '' ,
349+ 'el_classes' : 'menu-item menu-item-depth-0 menu-item-custom menu-item-edit-inactive' ,
350+ 'instanceNumber' : 46 ,
351+ 'item_type' : 'custom' ,
352+ 'item_type_label' : 'Custom Link' ,
353+ 'label' : 'Sub-Example' ,
354+ 'menu_item_id' : 2001 ,
355+ 'original_title' : '' ,
356+ 'parent' : 2001 ,
357+ 'priority' : 3 ,
358+ 'section' : 'nav_menu[3]' ,
359+ 'settings' : {
360+ 'default' : 'nav_menu_item[2002]'
361+ } ,
362+ 'target' : '' ,
363+ 'title' : 'Sub-Example' ,
364+ 'type' : 'nav_menu_item' ,
365+ 'url' : 'http://sub.example.com/' ,
366+ 'xfn' : ''
367+ } ;
368+
369+ // Meta controls
370+ window . _wpCustomizeSettings . sections . add_menu = {
371+ 'id' : 'add_menu' ,
372+ 'description' : '' ,
373+ 'priority' : 999 ,
374+ 'panel' : 'nav_menus' ,
375+ 'type' : 'new_menu' ,
376+ 'title' : 'Add a Menu' ,
377+ 'content' : '<li id="accordion-section-add_menu" class="accordion-section-new-menu">\n\t\t\t<button type="button" class="button-secondary add-new-menu-item add-menu-toggle" aria-expanded="false">\n\t\t\t\tAdd a Menu\t\t\t<\/button>\n\t\t\t<ul class="new-menu-section-content"><\/ul>\n\t\t<\/li>' ,
378+ 'active' : true ,
379+ 'instanceNumber' : 16 ,
380+ 'customizeAction' : 'Customizing ▸ Menus'
381+ } ;
382+ window . _wpCustomizeSettings . controls . new_menu_name = {
383+ 'settings' : { 'default' : 'new_menu_name' } ,
384+ 'type' : 'text' ,
385+ 'priority' : 10 ,
386+ 'active' : true ,
387+ 'section' : 'add_menu' ,
388+ 'content' : '<li id="customize-control-new_menu_name" class="customize-control customize-control-text"> <label> <input type="text" class="menu-name-field" placeholder="New menu name" value="" data-customize-setting-link="new_menu_name" /> </label> </li>' ,
389+ 'label' : '' ,
390+ 'description' : '' ,
391+ 'instanceNumber' : 46
392+ } ;
393+ window . _wpCustomizeSettings . settings . new_menu_name = {
394+ 'value' : '' ,
395+ 'transport' : 'postMessage' ,
396+ 'dirty' : false
397+ } ;
398+
399+ // From nav-menu.js
112400window . wpNavMenu = {
113401 'options' : {
114402 'menuItemDepthPerLevel' : 30 ,
@@ -120,4 +408,3 @@ window.wpNavMenu = {
120408 'isRTL' : false ,
121409 'negateIfRTL' : 1
122410} ;
123-
0 commit comments