__checked_selected_helper

The timeline below displays how wordpress function __checked_selected_helper has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.2

/**
 * Private helper function for checked, selected, disabled and readonly.
 *
 * Compares the first two arguments and if identical marks as `$type`.
 *
 * @since 2.8.0
 * @access private
 *
 * @param mixed  $helper  One of the values to compare.
 * @param mixed  $current The other value to compare if not just true.
 * @param bool   $display Whether to echo or just return the string.
 * @param string $type    The type of checked|selected|disabled|readonly we are doing.
 * @return string HTML attribute or empty string.
 */
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;
}

WordPress Version: 5.9

/**
 * Private helper function for checked, selected, disabled and readonly.
 *
 * Compares the first two arguments and if identical marks as `$type`.
 *
 * @since 2.8.0
 * @access private
 *
 * @param mixed  $helper  One of the values to compare.
 * @param mixed  $current The other value to compare if not just true.
 * @param bool   $echo    Whether to echo or just return the string.
 * @param string $type    The type of checked|selected|disabled|readonly we are doing.
 * @return string HTML attribute or empty string.
 */
function __checked_selected_helper($helper, $current, $echo, $type)
{
    // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore
    if ((string) $helper === (string) $current) {
        $result = " {$type}='{$type}'";
    } else {
        $result = '';
    }
    if ($echo) {
        echo $result;
    }
    return $result;
}

WordPress Version: 5.5

/**
 * Private helper function for checked, selected, disabled and readonly.
 *
 * Compares the first two arguments and if identical marks as $type
 *
 * @since 2.8.0
 * @access private
 *
 * @param mixed  $helper  One of the values to compare
 * @param mixed  $current (true) The other value to compare if not just true
 * @param bool   $echo    Whether to echo or just return the string
 * @param string $type    The type of checked|selected|disabled|readonly we are doing
 * @return string HTML attribute or empty string
 */
function __checked_selected_helper($helper, $current, $echo, $type)
{
    // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore
    if ((string) $helper === (string) $current) {
        $result = " {$type}='{$type}'";
    } else {
        $result = '';
    }
    if ($echo) {
        echo $result;
    }
    return $result;
}

WordPress Version: 5.3

/**
 * Private helper function for checked, selected, disabled and readonly.
 *
 * Compares the first two arguments and if identical marks as $type
 *
 * @since 2.8.0
 * @access private
 *
 * @param mixed  $helper  One of the values to compare
 * @param mixed  $current (true) The other value to compare if not just true
 * @param bool   $echo    Whether to echo or just return the string
 * @param string $type    The type of checked|selected|disabled|readonly we are doing
 * @return string html attribute or empty string
 */
function __checked_selected_helper($helper, $current, $echo, $type)
{
    // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore
    if ((string) $helper === (string) $current) {
        $result = " {$type}='{$type}'";
    } else {
        $result = '';
    }
    if ($echo) {
        echo $result;
    }
    return $result;
}

WordPress Version: 4.9

/**
 * Private helper function for checked, selected, disabled and readonly.
 *
 * Compares the first two arguments and if identical marks as $type
 *
 * @since 2.8.0
 * @access private
 *
 * @param mixed  $helper  One of the values to compare
 * @param mixed  $current (true) The other value to compare if not just true
 * @param bool   $echo    Whether to echo or just return the string
 * @param string $type    The type of checked|selected|disabled|readonly we are doing
 * @return string html attribute or empty string
 */
function __checked_selected_helper($helper, $current, $echo, $type)
{
    if ((string) $helper === (string) $current) {
        $result = " {$type}='{$type}'";
    } else {
        $result = '';
    }
    if ($echo) {
        echo $result;
    }
    return $result;
}

WordPress Version: 4.3

/**
 * Private helper function for checked, selected, and disabled.
 *
 * Compares the first two arguments and if identical marks as $type
 *
 * @since 2.8.0
 * @access private
 *
 * @param mixed  $helper  One of the values to compare
 * @param mixed  $current (true) The other value to compare if not just true
 * @param bool   $echo    Whether to echo or just return the string
 * @param string $type    The type of checked|selected|disabled we are doing
 * @return string html attribute or empty string
 */
function __checked_selected_helper($helper, $current, $echo, $type)
{
    if ((string) $helper === (string) $current) {
        $result = " {$type}='{$type}'";
    } else {
        $result = '';
    }
    if ($echo) {
        echo $result;
    }
    return $result;
}

WordPress Version: 3.7

/**
 * Private helper function for checked, selected, and disabled.
 *
 * Compares the first two arguments and if identical marks as $type
 *
 * @since 2.8.0
 * @access private
 *
 * @param mixed $helper One of the values to compare
 * @param mixed $current (true) The other value to compare if not just true
 * @param bool $echo Whether to echo or just return the string
 * @param string $type The type of checked|selected|disabled we are doing
 * @return string html attribute or empty string
 */
function __checked_selected_helper($helper, $current, $echo, $type)
{
    if ((string) $helper === (string) $current) {
        $result = " {$type}='{$type}'";
    } else {
        $result = '';
    }
    if ($echo) {
        echo $result;
    }
    return $result;
}