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
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |
Allow Skype call links.
Currently wp_kses_post will filter a URL that uses `somelink`.
Here’s how you can allow it:
`
add_filter( ‘kses_allowed_protocols’, function( $protocols ) {
$protocols[] = ‘javascript’;
return $protocols;
} );
`
add_filter( ‘kses_allowed_protocols’, function( $protocols ) { $protocols[] = ‘javascript’; return $protocols; } );The filter should to run before init.
Note: this example only works in PHP 5.3+