[ Index ]

WordPress Cross Reference

title

Body

[close]

/wp-includes/ -> nav-menu.php (summary)

Navigation Menu functions

File Size: 794 lines (26 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 22 functions

  wp_get_nav_menu_object()
  is_nav_menu()
  register_nav_menus()
  unregister_nav_menu()
  register_nav_menu()
  get_registered_nav_menus()
  get_nav_menu_locations()
  has_nav_menu()
  is_nav_menu_item()
  wp_create_nav_menu()
  wp_delete_nav_menu()
  wp_update_nav_menu_object()
  wp_update_nav_menu_item()
  wp_get_nav_menus()
  _sort_nav_menu_items()
  _is_valid_nav_menu_item()
  wp_get_nav_menu_items()
  wp_setup_nav_menu_item()
  wp_get_associated_nav_menu_items()
  _wp_delete_post_menu_item()
  _wp_delete_tax_menu_item()
  _wp_auto_add_pages_to_menu()

Functions
Functions that are not part of a class:

wp_get_nav_menu_object( $menu )   X-Ref
Returns a navigation menu object.

param: string $menu Menu id, slug or name
return: mixed false if $menu param isn't supplied or term does not exist, menu object if successful.

is_nav_menu( $menu )   X-Ref
Check if the given ID is a navigation menu.

Returns true if it is; false otherwise.

param: int|string $menu The menu to check (id, slug, or name)
return: bool Whether the menu exists.

register_nav_menus( $locations = array()   X-Ref
Register navigation menus for a theme.

param: array $locations Associative array of menu location identifiers (like a slug) and descriptive text.

unregister_nav_menu( $location )   X-Ref
Unregisters a navigation menu for a theme.

param: array $location the menu location identifier
return: bool True on success, false on failure.

register_nav_menu( $location, $description )   X-Ref
Register a navigation menu for a theme.

param: string $location Menu location identifier, like a slug.
param: string $description Menu location descriptive text.

get_registered_nav_menus()   X-Ref
Returns an array of all registered navigation menus in a theme

return: array

get_nav_menu_locations()   X-Ref
Returns an array with the registered navigation menu locations and the menu assigned to it

return: array

has_nav_menu( $location )   X-Ref
Whether a registered nav menu location has a menu assigned to it.

param: string $location Menu location identifier.
return: bool Whether location has a menu.

is_nav_menu_item( $menu_item_id = 0 )   X-Ref
Determine whether the given ID is a nav menu item.

param: int $menu_item_id The ID of the potential nav menu item.
return: bool Whether the given ID is that of a nav menu item.

wp_create_nav_menu( $menu_name )   X-Ref
Create a Navigation Menu.

param: string $menu_name Menu Name
return: mixed Menu object on success|WP_Error on failure

wp_delete_nav_menu( $menu )   X-Ref
Delete a Navigation Menu.

param: string $menu name|id|slug
return: mixed Menu object on success|WP_Error on failure

wp_update_nav_menu_object( $menu_id = 0, $menu_data = array()   X-Ref
Save the properties of a menu or create a new menu with those properties.

param: int $menu_id The ID of the menu or "0" to create a new menu.
param: array $menu_data The array of menu data.
return: int|error object The menu's ID or WP_Error object.

wp_update_nav_menu_item( $menu_id = 0, $menu_item_db_id = 0, $menu_item_data = array()   X-Ref
Save the properties of a menu item or create a new one.

param: int $menu_id The ID of the menu. Required. If "0", makes the menu item a draft orphan.
param: int $menu_item_db_id The ID of the menu item. If "0", creates a new menu item.
param: array $menu_item_data The menu item's data.
return: int The menu item's database ID or WP_Error object on failure.

wp_get_nav_menus( $args = array()   X-Ref
Returns all navigation menu objects.

param: array $args Array of arguments passed on to get_terms().
return: array menu objects

_sort_nav_menu_items( $a, $b )   X-Ref
Sort menu items by the desired key.

param: object $a The first object to compare
param: object $b The second object to compare
return: int -1, 0, or 1 if $a is considered to be respectively less than, equal to, or greater than $b.

_is_valid_nav_menu_item( $item )   X-Ref
Returns if a menu item is valid. Bug #13958

param: object $menu_item The menu item to check
return: bool false if invalid, else true.

wp_get_nav_menu_items( $menu, $args = array()   X-Ref
Returns all menu items of a navigation menu.

param: string $menu menu name, id, or slug
param: string $args
return: mixed $items array of menu items, else false.

wp_setup_nav_menu_item( $menu_item )   X-Ref
Decorates 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.

param: object $menu_item The menu item to modify.
return: object $menu_item The menu item with standard menu item properties.

wp_get_associated_nav_menu_items( $object_id = 0, $object_type = 'post_type', $taxonomy = '' )   X-Ref
Get the menu items associated with a particular object.

param: int $object_id The ID of the original object.
param: string $object_type The type of object, such as "taxonomy" or "post_type."
param: string $taxonomy If $object_type is "taxonomy", $taxonomy is the name of the tax that $object_id belongs to
return: array The array of menu item IDs; empty array if none;

_wp_delete_post_menu_item( $object_id = 0 )   X-Ref
Callback for handling a menu item when its original object is deleted.

param: int $object_id The ID of the original object being trashed.

_wp_delete_tax_menu_item( $object_id = 0, $tt_id, $taxonomy )   X-Ref
Callback for handling a menu item when its original object is deleted.

param: int $object_id The ID of the original object being trashed.

_wp_auto_add_pages_to_menu( $new_status, $old_status, $post )   X-Ref
Automatically add newly published page objects to menus with that as an option.

param: string $new_status The new status of the post object.
param: string $old_status The old status of the post object.
param: object $post The post object being transitioned from one status to another.
return: void



Generated: Tue Mar 25 01:41:18 2014 WordPress honlapkészítés: online1.hu