| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | public function post($url, $data = null) |
||
| 34 | { |
||
| 35 | $response = wp_remote_post($url, array( |
||
| 36 | 'headers' => array( |
||
| 37 | 'Accept: application/json', |
||
| 38 | 'Content-Type: application/json' |
||
| 39 | ), |
||
| 40 | 'body' => json_encode($data), |
||
| 41 | 'timeout' => $this->timeout, |
||
| 42 | )); |
||
| 43 | if (is_array($response)) { |
||
| 44 | $response = json_decode($response['body'], true); |
||
| 45 | return $response; |
||
| 46 | } |
||
| 47 | } |
||
| 48 | |||
| 50 |