wc_selected()WC 1.0

Return the html selected attribute if stringified $value is found in array of stringified $options or if stringified $value is the same as scalar stringified $options.

Хуков нет.

Возвращает

Строку.

Использование

wc_selected( $value, $options );
$value(строка|int) (обязательный)
Value to find within options.
$options(строка|int|массив) (обязательный)
Options to go through when looking for value.

Код wc_selected() WC 8.7.0

function wc_selected( $value, $options ) {
	if ( is_array( $options ) ) {
		$options = array_map( 'strval', $options );
		return selected( in_array( (string) $value, $options, true ), true, false );
	}

	return selected( $value, $options, false );
}