wpcf7_log_remote_request()
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() wpcf7 log remote request CF7 6.1.6
function wpcf7_log_remote_request( $url, $request, $response ) {
if ( ! WP_DEBUG ) {
return;
}
$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 ) {
wp_trigger_error( '', $log, E_USER_NOTICE );
}
}