apply_filters( ‘kses_allowed_protocols’, string[] $protocols )

Filters the list of protocols allowed in HTML attributes.

Parameters

$protocolsstring[]
Array of allowed protocols e.g. 'http', 'ftp', 'tel', and more.

Source

$protocols = array_unique( (array) apply_filters( 'kses_allowed_protocols', $protocols ) );

Changelog

VersionDescription
3.0.0Introduced.

User Contributed Notes

  1. Skip to note 4 content

    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.