PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 2.2.3
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v2.2.3
3.7.5 3.7.4 3.7.3 3.7.2 1-final 3.7.1 3.7.0 3.6.8 3.6.7 3.6.6 3.6.5 3.6.4 3.6.3 3.6.2 3.6.1 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.10 All 111 releases
← All changes | includes/API/Login.php +23 -0 2.2.22.2.3 View file →
@@ -13,8 +13,12 @@
13 13 if ( '/templately/v1/login' === $_route ) {
14 14 return true;
15 15 }
16 16
17 + if ( '/templately/v1/pricing' === $_route ) {
18 + return true;
19 + }
20 +
17 21 return parent::permission_check( $request );
18 22 }
19 23
20 24 public function register_routes() {
@@ -20,9 +24,28 @@
20 24 public function register_routes() {
21 25 $this->post( 'login', [$this, 'login'] );
22 26 $this->post( 'logout', [$this, 'logout'] );
23 27 $this->get( 'is-signed', [$this, 'is_signed'] );
28 + $this->get( 'pricing', [$this, 'pricing'] );
24 29 }
30 +
31 + public function pricing(){
32 + $data = get_transient( "templately_subscriptions" );
33 +
34 + if( is_array( $data ) && ! empty( $data ) ) {
35 + return $data;
36 + }
37 +
38 + $query = 'id, price, name, discounted_price, type, sites';
39 + $response = $this->http()->query(
40 + 'subscriptionPlans',
41 + $query,
42 + )->post();
43 +
44 + set_transient( "templately_subscriptions", $response, WEEK_IN_SECONDS );
45 +
46 + return $response;
47 + }
25 48
26 49 public function login() {
27 50 $errors = [];
28 51 $_ip = Helper::get_ip();