apply_filters( ‘clean_url’, string $good_protocol_url, string $original_url, string $_context )

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

Parameters

$good_protocol_urlstring
The cleaned URL to be returned.
$original_urlstring
The URL prior to cleaning.
$_contextstring
If 'display', replace ampersands and single quotes only.

Source

return apply_filters( 'clean_url', $good_protocol_url, $original_url, $_context );

Changelog

VersionDescription
2.3.0Introduced.

User Contributed Notes

  1. Skip to note 2 content

    It seems to be hard to find a complete list of the possible contexts; as far as I could determine, besides the ‘display’ context, there is also the ‘db’ context (which has its own set of encapsulating functions), but I couldn’t find a reference to the full list of contexts.

    (The same comment applies to esc_url() too, of course; only ‘display’ is mentioned there as well.)

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