Private helper function for checked, selected, and disabled.

Compares the first two arguments and if identical marks as $type

Signature

__checked_selected_helper( $helper, $current, $echo, $type )
helper
 (mixed) One of the values to compare
current
 (mixed) (true) The other value to compare if not just true
echo
 (boolean) Whether to echo or just return the string
type
 (string) The type of checked|selected|disabled we are doing

Return

(string) html attribute or empty string

Source

function __checked_selected_helper( $helper, $current, $echo, $type ) {
	if ( (string) $helper === (string) $current )
		$result = " $type='$type'";
	else
		$result = '';

	if ( $echo )
		echo $result;

	return $result;
}
WP Trac GitHub

Link here