_is_valid_nav_menu_item(
$item
)
:
boolReturns if a menu item is valid. Bug #13958
Parameters
| Name |
Type |
Description |
| $item |
|
|
Returns
Details
- access
- private
- since
- 3.2.0
_sort_nav_menu_items(
object $a, object $b
)
:
intSort menu items by the desired key.
Parameters
| Name |
Type |
Description |
| $a |
object |
The first object to compare |
| $b |
object |
The second object to compare |
Returns
Details
- access
- private
- since
- 3.0.0
_wp_auto_add_pages_to_menu(
string $new_status, string $old_status, object $post
)
:
voidAutomatically add newly published page objects to menus with that as an option.
Parameters
| Name |
Type |
Description |
| $new_status |
string |
The new status of the post object. |
| $old_status |
string |
The old status of the post object. |
| $post |
object |
The post object being transitioned from one status to another. |
Details
- access
- private
- since
- 3.0.0
_wp_delete_post_menu_item(
int $object_id
=
0
)
:
Callback for handling a menu item when its original object is deleted.
Parameters
| Name |
Type |
Description |
| $object_id |
int |
The ID of the original object being trashed. |
Details
- access
- private
- since
- 3.0.0
_wp_delete_tax_menu_item(
int $object_id
=
0
)
:
Callback for handling a menu item when its original object is deleted.
Parameters
| Name |
Type |
Description |
| $object_id |
int |
The ID of the original object being trashed. |
Details
- access
- private
- since
- 3.0.0
get_nav_menu_locations(
)
:
arrayReturns an array with the registered navigation menu locations and the menu assigned to it
Returns
Details
- since
- 3.0.0
get_registered_nav_menus(
)
:
arrayReturns an array of all registered navigation menus in a theme
Returns
Details
- since
- 3.0.0
has_nav_menu(
string $location
)
:
boolWhether a registered nav menu location has a menu assigned to it.
Parameters
| Name |
Type |
Description |
| $location |
string |
Menu location identifier. |
Returns
Details
- since
- 3.0.0
is_nav_menu(
int|string $menu
)
:
boolCheck if the given ID is a navigation menu.
Returns true if it is; false otherwise.
Parameters
| Name |
Type |
Description |
| $menu |
int|string |
The menu to check (id, slug, or name)
|
Returns
Details
- since
- 3.0.0
is_nav_menu_item(
int $menu_item_id
=
0
)
:
boolDetermine whether the given ID is a nav menu item.
Parameters
| Name |
Type |
Description |
| $menu_item_id |
int |
The ID of the potential nav menu item. |
Returns
Details
- since
- 3.0.0
register_nav_menu(
string $location, string $description
)
:
Register a navigation menu for a theme.
Parameters
| Name |
Type |
Description |
| $location |
string |
Menu location identifier, like a slug. |
| $description |
string |
Menu location descriptive text. |
Details
- since
- 3.0.0
register_nav_menus(
array $locations
=
array
)
:
Register navigation menus for a theme.
Parameters
| Name |
Type |
Description |
| $locations |
array |
Associative array of menu location identifiers (like a slug) and descriptive text.
|
Details
- since
- 3.0.0
unregister_nav_menu(
array $location
)
:
boolUnregisters a navigation menu for a theme.
Parameters
| Name |
Type |
Description |
| $location |
array |
the menu location identifier |
Returns
wp_create_nav_menu(
string $menu_name
)
:
mixedCreate a Navigation Menu.
Parameters
| Name |
Type |
Description |
| $menu_name |
string |
Menu Name |
Returns
Details
- since
- 3.0.0
wp_delete_nav_menu(
string $menu
)
:
mixedDelete a Navigation Menu.
Parameters
| Name |
Type |
Description |
| $menu |
string |
name|id|slug |
Returns
Details
- since
- 3.0.0
wp_get_associated_nav_menu_items(
int $object_id
=
0, string $object_type
=
post_type
)
:
arrayGet the menu items associated with a particular object.
Parameters
| Name |
Type |
Description |
| $object_id |
int |
The ID of the original object. |
| $object_type |
string |
The type of object, such as "taxonomy" or "post_type."
|
Returns
Details
- since
- 3.0.0
wp_get_nav_menu_items(
string $menu, string $args
=
array
)
:
mixedReturns all menu items of a navigation menu.
Parameters
| Name |
Type |
Description |
| $menu |
string |
menu name, id, or slug |
| $args |
string |
|
Returns
Details
- since
- 3.0.0
wp_get_nav_menu_object(
string $menu
)
:
mixedReturns a navigation menu object.
Parameters
| Name |
Type |
Description |
| $menu |
string |
Menu id, slug or name |
Returns
Details
- since
- 3.0.0
- uses
- \get_term
- uses
- \get_term_by
wp_get_nav_menus(
array $args
=
array
)
:
arrayReturns all navigation menu objects.
Parameters
| Name |
Type |
Description |
| $args |
array |
Array of arguments passed on to get_terms().
|
Returns
Details
- since
- 3.0.0
wp_setup_nav_menu_item(
object $menu_item
)
:
objectDecorates a menu item object with the shared navigation menu item properties.
Properties:
- db_id: The DB ID of this item as a nav_menu_item object, if it exists (0 if it doesn't exist).
- object_id: The DB ID of the original object this menu item represents, e.g. ID for posts and term_id for categories.
- type: The family of objects originally represented, such as "post_type" or "taxonomy."
- object: The type of object originally represented, such as "category," "post", or "attachment."
- type_label: The singular label used to describe this type of menu item.
- post_parent: The DB ID of the original object's parent object, if any (0 otherwise).
- menu_item_parent: The DB ID of the nav_menu_item that is this item's menu parent, if any. 0 otherwise.
- url: The URL to which this menu item points.
- title: The title of this menu item.
- target: The target attribute of the link element for this menu item.
- attr_title: The title attribute of the link element for this menu item.
- classes: The array of class attribute values for the link element of this menu item.
- xfn: The XFN relationship expressed in the link of this menu item.
- description: The description of this menu item.
Parameters
| Name |
Type |
Description |
| $menu_item |
object |
The menu item to modify. |
Returns
Details
- since
- 3.0.0
wp_update_nav_menu_item(
int $menu_id
=
0, int $menu_item_db_id
=
0, array $menu_item_data
=
array
)
:
intSave the properties of a menu item or create a new one.
Parameters
| Name |
Type |
Description |
| $menu_id |
int |
The ID of the menu. Required. If "0", makes the menu item a draft orphan.
|
| $menu_item_db_id |
int |
The ID of the menu item. If "0", creates a new menu item.
|
| $menu_item_data |
array |
The menu item's data.
|
Returns
Details
- since
- 3.0.0
wp_update_nav_menu_object(
int $menu_id
=
0, array $menu_data
=
array
)
:
int|\errorSave the properties of a menu or create a new menu with those properties.
Parameters
| Name |
Type |
Description |
| $menu_id |
int |
The ID of the menu or "0" to create a new menu.
|
| $menu_data |
array |
The array of menu data. |
Returns
| Type |
Description |
| int\error |
|
Details
- since
- 3.0.0