ajax.php
3 weeks ago
install-notice.php
3 weeks ago
install-tracker.php
3 weeks ago
onboard-status.php
3 weeks ago
plugin-data-sender.php
1 year ago
plugin-installer.php
3 weeks ago
plugin-skin.php
1 year ago
plugin-status.php
4 years ago
utils.php
1 year ago
plugin-data-sender.php
32 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ElementsKit_Lite\Libs\Framework\Classes; |
| 4 | |
| 5 | use ElementsKit_Lite\Traits\Singleton; |
| 6 | |
| 7 | defined( 'ABSPATH' ) || exit; |
| 8 | |
| 9 | class Plugin_Data_Sender { |
| 10 | use Singleton; |
| 11 | |
| 12 | public function __construct() {} |
| 13 | |
| 14 | private function getUrl( $route ) { |
| 15 | return trailingslashit(\ElementsKit_Lite::api_url() . $route); |
| 16 | } |
| 17 | |
| 18 | public function sendEmailSubscribeData( $route, $data ) { |
| 19 | return wp_remote_post( |
| 20 | $this->getUrl( $route ), |
| 21 | array( |
| 22 | 'method' => 'POST', |
| 23 | 'headers' => array( |
| 24 | 'Accept' => '*/*', |
| 25 | 'Content-Type' => 'application/json' |
| 26 | ), |
| 27 | 'body' => wp_json_encode( $data ), |
| 28 | ) |
| 29 | ); |
| 30 | } |
| 31 | } |
| 32 |