#40947 closed defect (bug) (fixed)
Backward compatability _sort_nav_menu_items
Reported by: | PieWP | Owned by: | PieWP |
---|---|---|---|
Milestone: | 5.1 | Priority: | normal |
Severity: | normal | Version: | 4.7 |
Component: | Menus | Keywords: | good-first-bug has-patch commit |
Focuses: | docs | Cc: |
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
@
7 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
@
7 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
@
7 years ago
- Keywords has-patch added; needs-patch removed
- Type changed from defect (bug) to 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
@
7 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.
#7
@
7 years ago
- Keywords early removed
- Milestone changed from 5.0 to 4.9.1
- Type changed from enhancement to defect (bug)
#9
@
7 years ago
@PieWP setting this back to a bug as it's an issue with the docs and assigning to you as the owner.
Patch file setting the global