This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

__checked_selected_helper( mixed $helper, mixed $current, bool $display, string $type )

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


Description

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


Parameters

$helper

(Required) One of the values to compare.

$current

(Required) The other value to compare if not just true.

$display

(Required) Whether to echo or just return the string.

$type

(Required) The type of checked|selected|disabled|readonly we are doing.


Return

(string) HTML attribute or empty string.


Source

File: wp-includes/general-template.php

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

	if ( $echo )
		echo $result;

	return $result;
}


Changelog

Changelog
Version Description
2.8.0
CP-2.0.0 Output only an HTML5 value, not an attribute–value pair. Introduced. CP-2.0.0 Output only an HTML5 value, not an attribute–value pair.