wpcf7_log_remote_request()CF7 1.0

Triggers an error about a remote HTTP request and response.

Хуки из функции

Возвращает

null. Ничего (null).

Использование

wpcf7_log_remote_request( $url, $request, $response );
$url(строка) (обязательный)
The resource URL.
$request(массив) (обязательный)
Request arguments.
$response(массив|WP_Error) (обязательный)
The response or WP_Error on failure.

Код wpcf7_log_remote_request() CF7 5.9.3

function wpcf7_log_remote_request( $url, $request, $response ) {
	$log = sprintf(
		/* translators: 1: response code, 2: message, 3: body, 4: URL */
		__( 'HTTP Response: %1$s %2$s %3$s from %4$s', 'contact-form-7' ),
		(int) wp_remote_retrieve_response_code( $response ),
		wp_remote_retrieve_response_message( $response ),
		wp_remote_retrieve_body( $response ),
		$url
	);

	$log = apply_filters( 'wpcf7_log_remote_request',
		$log, $url, $request, $response
	);

	if ( $log ) {
		trigger_error( $log );
	}
}