System Status: Use is_wp_error() instead of is_object()
thanks @claudiosmweb!
This commit is contained in:
parent
3525b0f193
commit
5d4a57d8e2
|
@ -224,7 +224,7 @@ If enabled on your server, Suhosin may need to be configured to increase its dat
|
|||
$posting['wp_remote_post']['success'] = true;
|
||||
} else {
|
||||
$posting['wp_remote_post']['note'] = __( 'wp_remote_post() failed. PayPal IPN won\'t work with your server. Contact your hosting provider.', 'woocommerce' );
|
||||
if ( is_object( $response ) && $response->get_error_message() ) {
|
||||
if ( is_wp_error( $response ) ) {
|
||||
$posting['wp_remote_post']['note'] .= ' ' . sprintf( __( 'Error: %s', 'woocommerce' ), wc_clean( $response->get_error_message() ) );
|
||||
} else {
|
||||
$posting['wp_remote_post']['note'] .= ' ' . sprintf( __( 'Status code: %s', 'woocommerce' ), wc_clean( $response['response']['code'] ) );
|
||||
|
@ -242,7 +242,7 @@ If enabled on your server, Suhosin may need to be configured to increase its dat
|
|||
$posting['wp_remote_get']['success'] = true;
|
||||
} else {
|
||||
$posting['wp_remote_get']['note'] = __( 'wp_remote_get() failed. The WooCommerce plugin updater won\'t work with your server. Contact your hosting provider.', 'woocommerce' );
|
||||
if ( is_object( $response ) && $response->get_error_message() ) {
|
||||
if ( is_wp_error( $response ) ) {
|
||||
$posting['wp_remote_get']['note'] .= ' ' . sprintf( __( 'Error: %s', 'woocommerce' ), wc_clean( $response->get_error_message() ) );
|
||||
} else {
|
||||
$posting['wp_remote_get']['note'] .= ' ' . sprintf( __( 'Status code: %s', 'woocommerce' ), wc_clean( $response['response']['code'] ) );
|
||||
|
|
Loading…
Reference in New Issue