A WordPress-centric search engine for devs and theme authors



__checked_selected_helper ›

Since2.8.0
Deprecatedn/a
__checked_selected_helper ( $helper, $current, $echo, $type )
Access:
  • private
Parameters: (4)
  • (mixed) $helper One of the values to compare
    Required: Yes
  • (mixed) $current (true) The other value to compare if not just true
    Required: Yes
  • (bool) $echo Whether to echo or just return the string
    Required: Yes
  • (string) $type The type of checked|selected|disabled we are doing
    Required: Yes
Returns:
  • (string) html attribute or empty string
Defined at:
Codex:

Private helper function for checked, selected, and disabled.

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



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;
}