http_request_reject_unsafe_urls
Filters whether to pass URLs through wp_http_validate_url() in an HTTP request.
Использование
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().
По умолчанию: false - $url(строка)
- The request URL.
Список изменений
С версии 3.6.0 | Введена. |
С версии 5.1.0 | The $url parameter was added. |
Где вызывается хук
http_request_reject_unsafe_urls
wp-includes/class-wp-http.php 203
'reject_unsafe_urls' => apply_filters( 'http_request_reject_unsafe_urls', false, $url ),