Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#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)

#1 @helen
13 years ago

  • Milestone Awaiting Review
  • Resolutioninvalid
  • Status newclosed

Since selected() is comparing values, you should see if in_array() returns true.

$value = '1';
selected( true, in_array( $value, array( '1', '3' ) ) );
Version 0, edited 13 years ago by helen (next)
Note: See TracTickets for help on using tickets.