| @@ -35,9 +35,9 @@ | ||
| 35 | 35 | * |
| 36 | 36 | * @return string |
| 37 | 37 | */ |
| 38 | 38 | protected function get_endpoint() { |
| 39 | - return apply_filters( 'flywp_api_endpoint', 'https://app.flywp.com/site-api' ); | |
| 39 | + return apply_filters( 'flywp_api_endpoint', 'https://app.flywp.com/api/site-api' ); | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * Send a GET request to the API. |
| @@ -72,9 +72,9 @@ | ||
| 72 | 72 | /** |
| 73 | 73 | * Send a POST request to the API. |
| 74 | 74 | * |
| 75 | 75 | * @param string $path |
| 76 | - * @param array $data | |
| 76 | + * @param array $data | |
| 77 | 77 | * |
| 78 | 78 | * @return array|false |
| 79 | 79 | */ |
| 80 | 80 | public function post( $path, $data = [] ) { |
| @@ -85,15 +85,13 @@ | ||
| 85 | 85 | [ |
| 86 | 86 | 'headers' => [ |
| 87 | 87 | 'Authorization' => 'Bearer ' . flywp()->get_key(), |
| 88 | 88 | ], |
| 89 | - 'body' => $data, | |
| 89 | + 'body' => $data, | |
| 90 | 90 | ] |
| 91 | 91 | ); |
| 92 | 92 | |
| 93 | 93 | if ( is_wp_error( $response ) ) { |
| 94 | - error_log( print_r( $response, true ) ); | |
| 95 | - | |
| 96 | 94 | return false; |
| 97 | 95 | } |
| 98 | 96 | |
| 99 | 97 | $body = wp_remote_retrieve_body( $response ); |