wp_setup_nav_menu_item


wp_setup_nav_menu_item ( $menu_item )

Parameters:
  • (object) menu_item The menu item to modify.
Returns:
  • (object) The menu item with standard menu item properties.
Defined at:

Description

Decorates a menu item object with the shared navigation menu item properties.Properties: - ID: The term_id if the menu item represents a taxonomy term. - 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. - db_id: The DB ID of this item as a nav_menu_item object, if it exists (0 if it doesn't exist). - description: The description of this menu item. - menu_item_parent: The DB ID of the nav_menu_item that is this item's menu parent, if any. 0 otherwise. - object: The type of object originally represented, such as 'category', 'post', or 'attachment'. - object_id: The DB ID of the original object this menu item represents, e.g. ID for posts and term_id for categories. - post_parent: The DB ID of the original object's parent object, if any (0 otherwise). - post_title: A "no title" label if menu item represents a post that lacks a title. - target: The target attribute of the link element for this menu item. - title: The title of this menu item. - type: The family of objects originally represented, such as 'post_type' or 'taxonomy'. - type_label: The singular label used to describe this type of menu item. - url: The URL to which this menu item points. - xfn: The XFN relationship expressed in the link of this menu item. - _invalid: Whether the menu item represents an object that no longer exists.

Related Functions

wp_get_nav_menu_items, wp_save_nav_menu_items, wp_update_nav_menu_item, _sort_nav_menu_items, is_nav_menu_item

Top Google Results

User discussions

wpseek mobile