PluginProbe
Assistant – Every Day Productivity Apps / 1.0
Assistant – Every Day Productivity Apps v1.0
1.5.5 trunk 0.1.0 0.2.0 0.2.1 0.2.2 0.3.0 0.3.1 0.4 0.4.1 0.4.2 0.5.0 0.5.1 0.6.0 0.7.0 0.7.0.2 0.7.0.3 0.7.0.4 0.7.0.5 0.7.0.6 0.7.0.7 0.7.0.8 0.7.0.9 0.7.1 1.0 All 71 releases
assistant / backend / src / Hooks / Actions / OnCustomizeRegister.php

OnCustomizeRegister.php in Assistant – Every Day Productivity Apps 1.0, at backend/src/Hooks/Actions/OnCustomizeRegister.php

39 lines 938 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FL\Assistant\Hooks\Actions;
4
5 use FL\Assistant\Services\CustomizerService;
6
7 /**
8 * Class OnCustomizeRegister
9 * @package FL\Assistant\Hooks\Actions
10 */
11 class OnCustomizeRegister {
12
13 public function __invoke() {
14 $this->init_customizer_requests();
15 }
16
17 protected function init_customizer_requests() {
18 if ( current_user_can( 'edit_theme_options' ) ) {
19
20 if ( isset( $_POST['fl_assistant_export'] ) && is_numeric( $_POST['fl_assistant_export'] ) ) {
21
22 $id = absint( $_POST['fl_assistant_export'] );
23 $service = new CustomizerService();
24 $response = $service->export_to_cloud( $id );
25
26 wp_send_json( $response );
27
28 } else if ( isset( $_POST['fl_assistant_import'] ) && is_numeric( $_POST['fl_assistant_import'] ) ) {
29
30 $id = absint( $_POST['fl_assistant_import'] );
31 $service = new CustomizerService();
32 $response = $service->import_from_cloud( $id );
33
34 wp_send_json( $response );
35 }
36 }
37 }
38 }
39