Plugin Directory

Changeset 3084947


Ignore:
Timestamp:
05/11/2024 11:42:48 AM (22 months ago)
Author:
codeleftover
Message:

Api issue fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • optinable/trunk/includes/core-functions.php

    r3028876 r3084947  
    173173    );
    174174
    175     wp_remote_post($api_url, $args);
     175    $response = wp_remote_post($api_url, $args);
     176
     177    if ( is_wp_error( $response ) ) {
     178        $error_message = $response->get_error_message();
     179        error_log( "API request failed: $error_message" );
     180    } else {
     181        $response_body = wp_remote_retrieve_body( $response );
     182        error_log( "API response: $response_body" );
     183    }
     184
     185   
    176186}
    177187
Note: See TracChangeset for help on using the changeset viewer.