PluginProbe
Elementor Website Builder – more than just a page builder / 4.1.0
Elementor Website Builder – more than just a page builder v4.1.0
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / modules / checklist / data / endpoints / user-progress.php

user-progress.php in Elementor Website Builder – more than just a page builder 4.1.0, at modules/checklist/data/endpoints/user-progress.php

47 lines 1021 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor\Modules\Checklist\Data\Endpoints;
3
4 use Elementor\Data\V2\Base\Endpoint as Endpoint_Base;
5 use Elementor\Modules\Checklist\Module as Checklist_Module;
6
7 if ( ! defined( 'ABSPATH' ) ) {
8 exit; // Exit if accessed directly.
9 }
10
11 class User_Progress extends Endpoint_Base {
12 protected function register() {
13 parent::register();
14
15 $this->register_items_route( \WP_REST_Server::EDITABLE );
16 }
17
18 public function get_name(): string {
19 return 'user-progress';
20 }
21
22 public function get_format(): string {
23 return 'checklist';
24 }
25
26 public function get_items( $request ) {
27 return $this->get_checklist_data();
28 }
29
30 public function update_items( $request ) {
31 Checklist_Module::instance()->update_user_progress( $request->get_json_params() );
32
33 return [
34 'data' => 'success',
35 ];
36 }
37
38 private function get_checklist_data(): array {
39 $checklist_module = Checklist_Module::instance();
40 $progress_data = $checklist_module->get_user_progress_from_db();
41
42 return [
43 'data' => $progress_data,
44 ];
45 }
46 }
47