Un motore di ricerca WordPress per sviluppatori e autori di temi



__checked_selected_helper ›

Da2.8.0
Deprecaton/a
__checked_selected_helper ( $helper, $current, $echo, $type )
Accedi:
  • private
Parametri: (4)
  • (mixed) $helper One of the values to compare
    Richiesto:
  • (mixed) $current (true) The other value to compare if not just true
    Richiesto:
  • (bool) $echo Whether to echo or just return the string
    Richiesto:
  • (string) $type The type of checked|selected|disabled|readonly we are doing
    Richiesto:
Ritorna:
  • (string) html attribute or empty string
Definito a:
Codex:

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

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



Sorgenti

function __checked_selected_helper( $helper, $current, $echo, $type ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore
	if ( (string) $helper === (string) $current ) {
		$result = " $type='$type'";
	} else {
		$result = '';
	}

	if ( $echo ) {
		echo $result;
	}

	return $result;
}