Private helper function for checked, selected, disabled and readonly.
Description
Compares the first two arguments and if identical marks as $type
.
Parameters
$helper
mixedrequired- One of the values to compare.
$current
mixedrequired- The other value to compare if not just true.
$display
boolrequired- Whether to echo or just return the string.
$type
stringrequired- The type of
checked|selected|disabled|readonly
we are doing.
Source
function __checked_selected_helper( $helper, $current, $display, $type ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore
if ( (string) $helper === (string) $current ) {
$result = " $type='$type'";
} else {
$result = '';
}
if ( $display ) {
echo $result;
}
return $result;
}
Changelog
Version | Description |
---|---|
2.8.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.