clean_url filter-hookWP 2.3.0

Filters a string cleaned and escaped for output as a URL.

Usage

add_filter( 'clean_url', 'wp_kama_clean_url_filter', 10, 3 );

/**
 * Function for `clean_url` filter-hook.
 * 
 * @param string $good_protocol_url The cleaned URL to be returned.
 * @param string $original_url      The URL prior to cleaning.
 * @param string $_context          If 'display', replace ampersands and single quotes only.
 *
 * @return string
 */
function wp_kama_clean_url_filter( $good_protocol_url, $original_url, $_context ){

	// filter...
	return $good_protocol_url;
}
$good_protocol_url(string)
The cleaned URL to be returned.
$original_url(string)
The URL prior to cleaning.
$_context(string)
If 'display', replace ampersands and single quotes only.

Changelog

Since 2.3.0 Introduced.

Where the hook is called

esc_url()
clean_url
wp-includes/formatting.php 4457
return apply_filters( 'clean_url', $good_protocol_url, $original_url, $_context );

Where the hook is used in WordPress

Usage not found.