PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 3.2.3
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v3.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
templately / includes / Core / Importer / Runners / Customizer.php

Customizer.php in Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! 3.2.3, at includes/Core/Importer/Runners/Customizer.php

59 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Templately\Core\Importer\Runners;
4
5 use Exception;
6 use Templately\Core\Importer\Form;
7 use Templately\Core\Importer\Runners\BaseRunner;
8 use Templately\Core\Importer\Utils\Utils;
9
10 class Customizer extends BaseRunner {
11
12 public function get_name(): string {
13 return 'customizer';
14 }
15
16 public function get_label(): string {
17 return __( 'Customizer', 'templately' );
18 }
19
20 public function should_log(): bool {
21 return true;
22 }
23
24 public function get_action(): string {
25 return 'eventLog';
26 }
27
28 public function log_message(): string {
29 return __( 'Updating customizer settings.', 'templately' );
30 }
31
32 public function should_run( $data, $imported_data = [] ): bool {
33 $params = $this->origin->get_request_params();
34 return ! empty( $params['title'] ) || !empty( $params['slogan'] );
35 }
36
37 public function import( $data, $imported_data ): array {
38 $params = $this->origin->get_request_params();
39 $customizer = [];
40
41 $this->log( 0 );
42
43 if( ! empty( $params['title'] ) ) {
44 $customizer[] = 'title';
45 // set_theme_mod( 'blogname', $params['title'] );
46 Utils::update_option( 'blogname', $params['title'] );
47 }
48
49 // update Tagline
50 if( ! empty( $params['slogan'] ) ) {
51 $customizer[] = 'slogan';
52 // set_theme_mod( 'blogdescription', $params['slogan'] );
53 Utils::update_option( 'blogdescription', $params['slogan'] );
54 }
55
56 return [ 'customizer' => $customizer ];
57 }
58
59 }