http_request_reject_unsafe_urls
Filters whether to pass URLs through wp_http_validate_url() in an HTTP request.
Usage
add_filter( 'http_request_reject_unsafe_urls', 'wp_kama_http_request_reject_unsafe_urls_filter', 10, 2 );
/**
* Function for `http_request_reject_unsafe_urls` filter-hook.
*
* @param bool $pass_url Whether to pass URLs through wp_http_validate_url().
* @param string $url The request URL.
*
* @return bool
*/
function wp_kama_http_request_reject_unsafe_urls_filter( $pass_url, $url ){
// filter...
return $pass_url;
}
- $pass_url(true|false)
- Whether to pass URLs through wp_http_validate_url().
Default: false - $url(string)
- The request URL.
Changelog
| Since 3.6.0 | Introduced. |
| Since 5.1.0 | The $url parameter was added. |
Where the hook is called
http_request_reject_unsafe_urls
wp-includes/class-wp-http.php 221
'reject_unsafe_urls' => apply_filters( 'http_request_reject_unsafe_urls', false, $url ),