wp_pre_kses_less_than_callback

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

WordPress Version: 6.3

/**
 * Callback function used by preg_replace.
 *
 * @since 2.3.0
 *
 * @param string[] $matches Populated by matches to preg_replace.
 * @return string The text returned after esc_html if needed.
 */
function wp_pre_kses_less_than_callback($matches)
{
    if (!str_contains($matches[0], '>')) {
        return esc_html($matches[0]);
    }
    return $matches[0];
}

WordPress Version: 5.9

/**
 * Callback function used by preg_replace.
 *
 * @since 2.3.0
 *
 * @param string[] $matches Populated by matches to preg_replace.
 * @return string The text returned after esc_html if needed.
 */
function wp_pre_kses_less_than_callback($matches)
{
    if (false === strpos($matches[0], '>')) {
        return esc_html($matches[0]);
    }
    return $matches[0];
}

WordPress Version: 4.1

/**
 * Callback function used by preg_replace.
 *
 * @since 2.3.0
 *
 * @param array $matches Populated by matches to preg_replace.
 * @return string The text returned after esc_html if needed.
 */
function wp_pre_kses_less_than_callback($matches)
{
    if (false === strpos($matches[0], '>')) {
        return esc_html($matches[0]);
    }
    return $matches[0];
}

WordPress Version: 3.7

/**
 * Callback function used by preg_replace.
 *
 * @uses esc_html to format the $matches text.
 * @since 2.3.0
 *
 * @param array $matches Populated by matches to preg_replace.
 * @return string The text returned after esc_html if needed.
 */
function wp_pre_kses_less_than_callback($matches)
{
    if (false === strpos($matches[0], '>')) {
        return esc_html($matches[0]);
    }
    return $matches[0];
}