#25329 closed feature request (invalid)
selected function is not supporting the multiselect dropdown
| Reported by: | gchokeen | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | 3.6.1 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
Hi,
While I working with multiselect dropdown box, I realized [selected]http://codex.wordpress.org/Function_Reference/selected function is not supporting the multi select value. For example if selected function is not compatible to handle the array values.
I think we need to use in_array in the function to resolve this trouble.
selected('1',array('1','3'));
Change History (1)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Since
selected()is comparing values, you should see ifin_array()returns true. And since it can accept that the first value is just true or false, you can just use it as the first argument.