Opened 14 years ago
Last modified 5 years ago
#14439 new defect (bug)
Unable to get a post associated menu items for a specific menu
Reported by: | DreadLox | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | major | Version: | 3.1 |
Component: | Menus | Keywords: | has-patch needs-refresh |
Focuses: | Cc: |
Description
Hello,
The actual wp_get_associated_nav_menu_items function works well but gets menu items associated with an object from ANY menu. So a parameter needs to be added to specify a specific menu to get menu items associated with an object from a specific menu.
Patch is attached. The use of get_term() is needed because of the bug #14438
Attachments (2)
Change History (7)
#1
@
14 years ago
- Milestone changed from Awaiting Review to Future Release
Clever fix. Ultimately, you can do post-processing on this for now to fetch the menus for which the the meta items are assigned.
#2
@
14 years ago
- Keywords has-patch added
- Version set to 3.1
Any reason that 6 months old patch hasn't made it's way to 3.1 ?
#4
@
10 years ago
- Keywords has-patch added; needs-refresh removed
This can be useful in some situations, so I believe it should go into the core.
I've just refreshed the patch. The new patch is compatible with the latest function version (a $taxonomy
parameter was added in #15264), and in addition to the previous patch takes care of the following:
- Check for invalid menu ID
- Updated documentation
- Unit test case for correct usage of the new
$menu_id
parameter. - Unit test case for incorrect usage of the new
$menu_id
parameter.
Patch to solve the bug