Filter hook 'kses_allowed_protocols'

in WP Core File wp-includes/functions.php at line 7204

View Source

kses_allowed_protocols

Filter Hook
Description
Filters the list of protocols allowed in HTML attributes.

Hook Information

File Location wp-includes/functions.php View on GitHub
Hook Type Filter
Line Number 7204

Hook Parameters

Type Name Description
string[] $protocols Array of allowed protocols e.g. 'http', 'ftp', 'tel', and more.

Usage Examples

Basic Usage
<?php
// Hook into kses_allowed_protocols
add_filter('kses_allowed_protocols', 'my_custom_filter', 10, 1);

function my_custom_filter($protocols) {
    // Your custom filtering logic here
    return $protocols;
}

Source Code Context

wp-includes/functions.php:7204 - How this hook is used in WordPress core
<?php
7199  		 *
7200  		 * @since 3.0.0
7201  		 *
7202  		 * @param string[] $protocols Array of allowed protocols e.g. 'http', 'ftp', 'tel', and more.
7203  		 */
7204  		$protocols = array_unique( (array) apply_filters( 'kses_allowed_protocols', $protocols ) );
7205  	}
7206  
7207  	return $protocols;
7208  }
7209  

PHP Documentation

<?php
/**
		 * Filters the list of protocols allowed in HTML attributes.
		 *
		 * @since 3.0.0
		 *
		 * @param string[] $protocols Array of allowed protocols e.g. 'http', 'ftp', 'tel', and more.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/functions.php
Related Hooks

Related hooks will be displayed here in future updates.