function selected( $selected, $current = true, $echo = true ) {}

Outputs the html selected attribute.
Compares the first two arguments and if identical marks as selected


  • mixed $selected: One of the values to compare
  • mixed $current: (true) The other value to compare if not just true
  • bool $echo: Whether to echo or just return the string

Return values

returns:html attribute or empty string

Source code

function selected( $selected, $current = true, $echo = true ) {

	return __checked_selected_helper( $selected, $current, $echo, 'selected' );




No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: