#40947 closed defect (bug) (fixed)
Backward compatability _sort_nav_menu_items
| Reported by: | PieWP | Owned by: | PieWP |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.1 |
| Component: | Menus | Version: | 4.7 |
| Severity: | normal | Keywords: | good-first-bug has-patch commit |
| Cc: | Focuses: | docs |
Description
The function _sort_nav_menu_items() does no longer seem to be backwards compatible. This is due to the global $_menu_item_sort_prop no longer being set.
Its sibling function wp_get_nav_menu_items() should be responsible for setting this var and in the doc also actually refers to it, codewise it does nothing with it though.
I've attached a file fixing the backwards compatibility, not quite sure what is more important though. Fixing backwards compatibility or removing/cleaning up an additional global var. Either way I suggest either the patch gets applied or the PHP doc of $_menu_item_sort_prop gets updated.
Attachments (3)
Change History (16)
#2
@
9 years ago
@PieWP thanks for reporting and the patch!
Typically, it's best to generate the patch from the root of the repository to allow other contributors to more-easily apply the patch. That said, we can usually figure it out :)
I have taken the liberty of regenerating the patch.
I'm not sure of the history for $_menu_item_sort_prop so I'm going to look into it a bit before commenting on re-adding it.
#3
@
9 years ago
- Focuses docs added
- Keywords needs-patch good-first-bug added; has-patch 2nd-opinion removed
@PieWP I looked into the history here and _sort_nav_menu_items was deprecated in 4.7 in favor of wp_list_sort() and it looks like all references to that global only exist in that function.
I think the fix here is to update the docs for wp_get_nav_menu_items to remove a references to the global.
#4
@
9 years ago
- Keywords has-patch added; needs-patch removed
- Type defect (bug) → enhancement
@welcher Agreed, seem it was fixed in 4.7 anyway to no longer use the global. Added a patch file (from root) which updates the docs.
#6
@
9 years ago
Thanks for the patch update @PieWP. Now that we're in release candidate for 4.9, we'll have to get this into the next release.
#9
@
9 years ago
@PieWP setting this back to a bug as it's an issue with the docs and assigning to you as the owner.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Patch file setting the global