wphooks.info - pre_http_request

pre_http_request

(trunk - 5.1-alpha-44286)

The hook occurs in the following file:

wp-includes/class-http.php:
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
		 *  - boolean false (to avoid short-circuiting the response)
		 *
		 * Returning any other value may result in unexpected behaviour.
		 *
		 * @since 2.9.0
		 *
		 * @param false|array|WP_Error $preempt Whether to preempt an HTTP request's return value. Default false.
		 * @param array               $r        HTTP request arguments.
		 * @param string              $url      The request URL.
		 */
		$pre = apply_filters( 'pre_http_request', false, $r, $url );

		if ( false !== $pre ) {
			return $pre;
		}

		if ( function_exists( 'wp_kses_bad_protocol' ) ) {
			if ( $r['reject_unsafe_urls'] ) {
				$url = wp_http_validate_url( $url );
			}