wp_kses_hook

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

WordPress Version: 6.2

/**
 * You add any KSES hooks here.
 *
 * There is currently only one KSES WordPress hook, {@see 'pre_kses'}, and it is called here.
 * All parameters are passed to the hooks and expected to receive a string.
 *
 * @since 1.0.0
 *
 * @param string         $content           Content to filter through KSES.
 * @param array[]|string $allowed_html      An array of allowed HTML elements and attributes,
 *                                          or a context name such as 'post'. See wp_kses_allowed_html()
 *                                          for the list of accepted context names.
 * @param string[]       $allowed_protocols Array of allowed URL protocols.
 * @return string Filtered content through {@see 'pre_kses'} hook.
 */
function wp_kses_hook($content, $allowed_html, $allowed_protocols)
{
    /**
     * Filters content to be run through KSES.
     *
     * @since 2.3.0
     *
     * @param string         $content           Content to filter through KSES.
     * @param array[]|string $allowed_html      An array of allowed HTML elements and attributes,
     *                                          or a context name such as 'post'. See wp_kses_allowed_html()
     *                                          for the list of accepted context names.
     * @param string[]       $allowed_protocols Array of allowed URL protocols.
     */
    return apply_filters('pre_kses', $content, $allowed_html, $allowed_protocols);
}

WordPress Version: 5.5

/**
 * You add any KSES hooks here.
 *
 * There is currently only one KSES WordPress hook, {@see 'pre_kses'}, and it is called here.
 * All parameters are passed to the hooks and expected to receive a string.
 *
 * @since 1.0.0
 *
 * @param string         $string            Content to filter through KSES.
 * @param array[]|string $allowed_html      An array of allowed HTML elements and attributes,
 *                                          or a context name such as 'post'. See wp_kses_allowed_html()
 *                                          for the list of accepted context names.
 * @param string[]       $allowed_protocols Array of allowed URL protocols.
 * @return string Filtered content through {@see 'pre_kses'} hook.
 */
function wp_kses_hook($string, $allowed_html, $allowed_protocols)
{
    /**
     * Filters content to be run through KSES.
     *
     * @since 2.3.0
     *
     * @param string         $string            Content to filter through KSES.
     * @param array[]|string $allowed_html      An array of allowed HTML elements and attributes,
     *                                          or a context name such as 'post'. See wp_kses_allowed_html()
     *                                          for the list of accepted context names.
     * @param string[]       $allowed_protocols Array of allowed URL protocols.
     */
    return apply_filters('pre_kses', $string, $allowed_html, $allowed_protocols);
}

WordPress Version: 5.1

/**
 * You add any KSES hooks here.
 *
 * There is currently only one KSES WordPress hook, {@see 'pre_kses'}, and it is called here.
 * All parameters are passed to the hooks and expected to receive a string.
 *
 * @since 1.0.0
 *
 * @param string          $string            Content to filter through KSES.
 * @param array[]|string  $allowed_html      List of allowed HTML elements.
 * @param string[]        $allowed_protocols Array of allowed URL protocols.
 * @return string Filtered content through {@see 'pre_kses'} hook.
 */
function wp_kses_hook($string, $allowed_html, $allowed_protocols)
{
    /**
     * Filters content to be run through kses.
     *
     * @since 2.3.0
     *
     * @param string          $string            Content to run through KSES.
     * @param array[]|string  $allowed_html      Allowed HTML elements.
     * @param string[]        $allowed_protocols Array of allowed URL protocols.
     */
    return apply_filters('pre_kses', $string, $allowed_html, $allowed_protocols);
}

WordPress Version: 4.6

/**
 * You add any kses hooks here.
 *
 * There is currently only one kses WordPress hook, {@see 'pre_kses'}, and it is called here.
 * All parameters are passed to the hooks and expected to receive a string.
 *
 * @since 1.0.0
 *
 * @param string $string            Content to filter through kses
 * @param array  $allowed_html      List of allowed HTML elements
 * @param array  $allowed_protocols Allowed protocol in links
 * @return string Filtered content through {@see 'pre_kses'} hook.
 */
function wp_kses_hook($string, $allowed_html, $allowed_protocols)
{
    /**
     * Filters content to be run through kses.
     *
     * @since 2.3.0
     *
     * @param string $string            Content to run through kses.
     * @param array  $allowed_html      Allowed HTML elements.
     * @param array  $allowed_protocols Allowed protocol in links.
     */
    return apply_filters('pre_kses', $string, $allowed_html, $allowed_protocols);
}

WordPress Version: 4.3

/**
 * You add any kses hooks here.
 *
 * There is currently only one kses WordPress hook and it is called here. All
 * parameters are passed to the hooks and expected to receive a string.
 *
 * @since 1.0.0
 *
 * @param string $string            Content to filter through kses
 * @param array  $allowed_html      List of allowed HTML elements
 * @param array  $allowed_protocols Allowed protocol in links
 * @return string Filtered content through 'pre_kses' hook
 */
function wp_kses_hook($string, $allowed_html, $allowed_protocols)
{
    /**
     * Filter content to be run through kses.
     *
     * @since 2.3.0
     *
     * @param string $string            Content to run through kses.
     * @param array  $allowed_html      Allowed HTML elements.
     * @param array  $allowed_protocols Allowed protocol in links.
     */
    return apply_filters('pre_kses', $string, $allowed_html, $allowed_protocols);
}

WordPress Version: 3.9

/**
 * You add any kses hooks here.
 *
 * There is currently only one kses WordPress hook and it is called here. All
 * parameters are passed to the hooks and expected to receive a string.
 *
 * @since 1.0.0
 *
 * @param string $string Content to filter through kses
 * @param array $allowed_html List of allowed HTML elements
 * @param array $allowed_protocols Allowed protocol in links
 * @return string Filtered content through 'pre_kses' hook
 */
function wp_kses_hook($string, $allowed_html, $allowed_protocols)
{
    /**
     * Filter content to be run through kses.
     *
     * @since 2.3.0
     *
     * @param string $string            Content to run through kses.
     * @param array  $allowed_html      Allowed HTML elements.
     * @param array  $allowed_protocols Allowed protocol in links.
     */
    $string = apply_filters('pre_kses', $string, $allowed_html, $allowed_protocols);
    return $string;
}

WordPress Version: 3.7

/**
 * You add any kses hooks here.
 *
 * There is currently only one kses WordPress hook and it is called here. All
 * parameters are passed to the hooks and expected to receive a string.
 *
 * @since 1.0.0
 *
 * @param string $string Content to filter through kses
 * @param array $allowed_html List of allowed HTML elements
 * @param array $allowed_protocols Allowed protocol in links
 * @return string Filtered content through 'pre_kses' hook
 */
function wp_kses_hook($string, $allowed_html, $allowed_protocols)
{
    $string = apply_filters('pre_kses', $string, $allowed_html, $allowed_protocols);
    return $string;
}