wp_get_associated_nav_menu_items

SummerySummery

Get the menu items associated with a particular object.

Syntax

wp_get_associated_nav_menu_items( int $object_id, string $object_type = 'post_type', string $taxonomy = '' )

ParametersParameters

$object_id

(int) (Required) The ID of the original object.

$object_type

(string) (Optional) The type of object, such as 'taxonomy' or 'post_type'.

Default value: 'post_type'

$taxonomy

(string) (Optional) If $object_type is 'taxonomy', $taxonomy is the name of the tax that $object_id belongs to.

Default value: ''

ReturnReturn

(int[]) The array of menu item IDs; empty array if none;

SourceSource

File: wp-includes/nav-menu.php


			

ChangelogChangelog

Changelog
Version Description
3.0.0 Introduced.
Scroll to Top