Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #36590, comment 8


Ignore:
Timestamp:
04/20/2016 09:22:11 PM (9 years ago)
Author:
ericlewis
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #36590, comment 8

    initial v1  
    11In attachment:36590.diff, I've moved the variable expansion code into a separate function `wp_expand_nav_menu_post_data()`, and modified it to support multidimensional nesting. Feedback welcome on this implementation.
    22
    3 I've also added some tests. One still fails, as it seems `array_merge_recursive()` doesn't merge values under the same numeric index, and instead moves the value of one numeric index into the next numeric index (see the test output).
     3I've also added some tests. One still fails, as it seems `array_merge_recursive()` doesn't merge values under the same numeric index, and instead moves the value of one numeric index into the next numeric index (see [https://3v4l.org/r5paG this example]). Is there a good way to merge arrays recursively while preserving numeric key indexes?