| 1 |
<?php |
| 2 |
namespace Elementor\App\Modules\SiteBuilder\Connect; |
| 3 |
|
| 4 |
use Elementor\Core\Common\Modules\Connect\Apps\Library; |
| 5 |
|
| 6 |
if ( ! defined( 'ABSPATH' ) ) { |
| 7 |
exit; // Exit if accessed directly. |
| 8 |
} |
| 9 |
|
| 10 |
class App extends Library { |
| 11 |
const API_URL = 'https://my.elementor.com/api/v2/builder/'; |
| 12 |
|
| 13 |
public function get_title() { |
| 14 |
return esc_html__( 'Site Builder', 'elementor' ); |
| 15 |
} |
| 16 |
|
| 17 |
protected function get_slug() { |
| 18 |
return 'site-builder'; |
| 19 |
} |
| 20 |
|
| 21 |
protected function get_api_url() { |
| 22 |
if ( defined( 'ELEMENTOR_SITE_BUILDER_API_ORIGIN' ) ) { |
| 23 |
return ELEMENTOR_SITE_BUILDER_API_ORIGIN . '/api/v2/builder/'; |
| 24 |
} |
| 25 |
|
| 26 |
return static::API_URL; |
| 27 |
} |
| 28 |
|
| 29 |
public function get_home_screen() { |
| 30 |
return $this->http_request( |
| 31 |
'GET', |
| 32 |
'website-planner/session/home-screen', |
| 33 |
[ |
| 34 |
'headers' => [ |
| 35 |
'x-host-site-title' => (string) get_bloginfo( 'name' ), |
| 36 |
'x-host-site-context' => (string) get_bloginfo( 'description' ), |
| 37 |
], |
| 38 |
], |
| 39 |
[ |
| 40 |
'return_type' => static::HTTP_RETURN_TYPE_ARRAY, |
| 41 |
] |
| 42 |
); |
| 43 |
} |
| 44 |
} |
| 45 |
|