[wp-trac] [WordPress Trac] #41502: _wp_expand_nav_menu_post_data() corrupts multiple select (array value)
WordPress Trac
noreply at wordpress.org
Wed Dec 13 04:39:11 UTC 2017
#41502: _wp_expand_nav_menu_post_data() corrupts multiple select (array value)
---------------------------+------------------------------
Reporter: elliotcondon | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Menus | Version: 4.9
Severity: normal | Resolution:
Keywords: needs-testing | Focuses: administration
---------------------------+------------------------------
Comment (by elliotcondon):
Hi @dd32
Thanks for the reply.
I've just tried to replicate this issue using 2 text inputs as you have:
<input type="text" name="testing[]" value="A">
<input type="text" name="testing[]" value="B">
I can confirm that the JSON posted correctly contains both inputs:
{\"name\":\"testing[]\",\"value\":\"A\"},{\"name\":\"testing[]\",\"value\":\"B\"}
However, when printing out the $_POST array, the only "testing" is:
[testing] => B
The $_POST data does not contain an array (as expected). Instead, only a
single value.
This is very different to the results you have found.
I have included a fix within ACF that changes the JSON string so that
array values can correctly be posted. Can you please test on a site
without ACF, or any other plugin that may be fixing this?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41502#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list