apply_filters( 'kses_allowed_protocols', array $protocols )

Filters the list of protocols allowed in HTML attributes.


Description Description


Parameters Parameters

$protocols

(array) Array of allowed protocols e.g. 'http', 'ftp', 'tel', and more.


Top ↑

Source Source

File: wp-includes/functions.php

View on Trac


Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note content
    Contributed by hatul

    The filter should to run before init.

    Note: this example only works in PHP 5.3+

    function wpse_allow_sms_protocol( $protocols ) {
        $protocols[] = 'sms';
        return $protocols;
    }
    add_action('plugins_loaded', function(){add_filter('kses_allowed_protocols', 'wpse_allow_sms_protocol' );});
    print_r(wp_allowed_protocols());

You must log in before being able to contribute a note or feedback.