PluginProbe ʕ •ᴥ•ʔ
Superb Addons: Blocks, Patterns, Pre-built Pages, Sliders, Popups, Free Forms, Animations & More / 4.0.0
Superb Addons: Blocks, Patterns, Pre-built Pages, Sliders, Popups, Free Forms, Animations & More v4.0.0
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 4.0.0 trunk 1.0.0 2.0.0 2.0.1 2.0.2 2.0.3 3.0 3.0.1 3.0.2 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.2 3.1.3 3.2.0 3.2.1 3.2.2 3.2.4 3.2.5 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.4.5 3.4.6 3.5.0 3.5.1 3.5.2 3.5.3 3.5.4 3.5.6 3.5.7 3.5.8 3.5.9 3.6.0 3.6.1 3.6.2 3.7.0 3.7.1
superb-blocks / src / data / utils / wizard / wizard-items / class-wizard-item-extensions.php
superb-blocks / src / data / utils / wizard / wizard-items Last commit date
class-wizard-item-extensions.php 2 months ago class-wizard-item.php 2 months ago
class-wizard-item-extensions.php
106 lines
1 <?php
2
3 namespace SuperbAddons\Data\Utils\Wizard;
4
5 defined('ABSPATH') || exit();
6
7 class WizardItemFile extends WizardItem
8 {
9 public function __construct($slug, $type, $title)
10 {
11 $file_template = get_block_file_template(get_stylesheet() . '//' . $slug, $type);
12
13 parent::__construct($file_template);
14 $this->title = $title;
15 $this->type = $type;
16 $this->is_file_template = true;
17
18 if ($type === WizardItemTypes::WP_TEMPLATE_PART) {
19 $this->no_reload = true;
20 }
21 }
22 }
23
24 class WizardItemPage extends WizardItem
25 {
26 public function __construct($page)
27 {
28 parent::__construct($page);
29 $this->type = WizardItemTypes::PAGE;
30 $this->datatype = WizardItemTypes::PAGE;
31 $this->is_premium = isset($page->package) && $page->package === 'premium';
32 }
33 }
34
35 class WizardItemPattern extends WizardItem
36 {
37 public function __construct($pattern)
38 {
39 parent::__construct($pattern);
40 $this->type = WizardItemTypes::PATTERN;
41 $this->datatype = WizardItemTypes::PATTERN;
42 $this->is_premium = isset($pattern->package) && $pattern->package === 'premium';
43 $this->no_reload = true;
44 }
45 }
46
47
48 class WizardItemTemplate extends WizardItem
49 {
50 public function __construct($part, $regularTitle, $modifiedTitle, $hasModifiedTemplate)
51 {
52 parent::__construct($part);
53 $this->title = $hasModifiedTemplate ? $modifiedTitle : $regularTitle;
54 $this->no_reload = $this->type === WizardItemTypes::WP_TEMPLATE_PART;
55 }
56 }
57
58 class WizardItemStatic extends WizardItem
59 {
60 public function __construct($title, $pageId)
61 {
62 parent::__construct(false);
63 $this->id = 'spb-static-page';
64 $this->SetSlug('spb-static-page');
65 $this->title = $title;
66 $this->type = 'static';
67 $this->datatype = 'static';
68 $this->permalink = get_permalink($pageId);
69 }
70 }
71
72 class WizardItemIgnore extends WizardItem
73 {
74 public function __construct($title)
75 {
76 parent::__construct(false);
77 $this->id = false;
78 $this->SetSlug('spb-ignore-selection');
79 $this->title = $title;
80 $this->type = 'ignore';
81 $this->datatype = 'ignore';
82 }
83 }
84
85 class WizarditemRestorationPoint extends WizardItem
86 {
87 public $timestamp;
88
89 public function __construct($restorationPointId, $restorationPointArray)
90 {
91 $time_format = get_option('time_format');
92 $date_format = get_option('date_format');
93 $datetime_format = $time_format && $date_format ? $time_format . ', ' . $date_format : 'H:i, F j, Y';
94
95 parent::__construct(false);
96 $this->timestamp = $restorationPointArray['timestamp'];
97 $this->id = $restorationPointId;
98 $this->SetSlug($restorationPointArray['slug']);
99 $this->title = gmdate($datetime_format, $restorationPointArray['timestamp']);
100 $this->type = $restorationPointArray['type'];
101 $this->datatype = $this->type;
102 $this->category = isset($restorationPointArray['category']) ? $restorationPointArray['category'] : $this->GetBaseSlug();
103 $this->is_restoration_point = true;
104 }
105 }
106