Namespace: Menus

wp.customize. Menus

Classes

AvailableItemCollection
AvailableItemModel
AvailableMenuItemsPanelView
MenuAutoAddControl
MenuControl
MenuItemControl
MenuLocationControl
MenuLocationsControl
MenuNameControl
MenuSection
MenusPanel
NewMenuSection

Methods


<static> applySavedData(data)

When customize_save comes back with a success, make sure any inserted nav menus and items are properly re-added with their newly-assigned IDs.
Parameters:
Name Type Description
data object
Properties
Name Type Description
nav_menu_updates array
nav_menu_item_updates array
Source:

<static> focusMenuItemControl(menuItemId)

Focus a menu item control.
Parameters:
Name Type Description
menuItemId string
Source:

<static> generatePlaceholderAutoIncrementId()

Newly-created Nav Menus and Nav Menu Items have negative integer IDs which serve as placeholders until Save & Publish happens.
Source:
Returns:
Type
number

<static> getMenuControl(menuId)

Get the control for a given menu.
Parameters:
Name Type Description
menuId
Source:
Returns:
Type
Array:.<wp.customize.controlConstructor.menus:>

<static> getMenuItemControl(menuItemId)

Given a menu item ID, get the control associated with it.
Parameters:
Name Type Description
menuItemId string
Source:
Returns:
Type
object | null

<static> insertAutoDraftPost(params)

Insert a new `auto-draft` post.
Parameters:
Name Type Description
params object Parameters for the draft post to create.
Properties
Name Type Description
post_type string Post type to add.
post_title string Post title to use.
Since:
  • 4.7.0
Source:
Returns:
Promise resolved with the added post.
Type
jQuery.promise

<inner> displayNavMenuName(name)

Apply sanitize_text_field()-like logic to the supplied name, returning a "unnammed" fallback string if the name is then empty.
Parameters:
Name Type Description
name string
Source:
Returns:
Type
string

<inner> menuItemIdToSettingId(menuItemId)

Parameters:
Name Type Description
menuItemId String
Source: