mirror of
https://github.com/10h30/wp-strava.git
synced 2026-06-05 15:10:01 +09:00
Added API post debugging
This commit is contained in:
@@ -45,6 +45,21 @@ class WPStrava_API {
|
||||
|
||||
$response = wp_remote_post( $url . $uri, $args );
|
||||
|
||||
if ( WPSTRAVA_DEBUG ) {
|
||||
// phpcs:disable WordPress.PHP.DevelopmentFunctions -- Debug output.
|
||||
error_log(
|
||||
print_r(
|
||||
array(
|
||||
'url' => $url . $uri,
|
||||
'args' => $args,
|
||||
'response' => $response,
|
||||
),
|
||||
true
|
||||
)
|
||||
);
|
||||
// phpcs:enable
|
||||
}
|
||||
|
||||
if ( is_wp_error( $response ) ) {
|
||||
throw WPStrava_Exception::from_wp_error( $response );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user