Taxonomy slug by term ID

For a menu object $item:

  • $item->object stores the object the menu item refers to, e.g. ‘post’, ‘page’, ‘my-cpt’, or ‘my-taxonomy’ (the post type name, or the taxonomy name)
  • $item->type stores what ‘type’ of object is it, either: ‘post_type’ or ‘taxonomy’.

For custom links, these are both custom

Leave a Comment