Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



__checked_selected_helper ›

Seit2.8.0
Veraltetn/v
__checked_selected_helper ( $helper, $current, $echo, $type )
Zugriff:
  • private
Parameter: (4)
  • (mixed) $helper One of the values to compare
    Erforderlich: Ja
  • (mixed) $current (true) The other value to compare if not just true
    Erforderlich: Ja
  • (bool) $echo Whether to echo or just return the string
    Erforderlich: Ja
  • (string) $type The type of checked|selected|disabled|readonly we are doing
    Erforderlich: Ja
Gibt zurück:
  • (string) html attribute or empty string
Definiert in:
Codex:

Private helper function for checked, selected, disabled and readonly.

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



Quellcode

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

	if ( $echo ) {
		echo $result;
	}

	return $result;
}