PluginProbe
Post Grid Gutenberg Blocks – PostX / 2.4.5
Post Grid Gutenberg Blocks – PostX v2.4.5
5.0.39 5.0.38 5.0.37 5.0.36 5.0.35 5.0.34 5.0.33 5.0.32 5.0.31 5.0.30 5.0.29 5.0.28 5.0.27 5.0.26 5.0.25 5.0.23 5.0.24 5.0.22 5.0.21 5.0.20 5.0.19 5.0.18 5.0.17 2.1.1 2.1.2 All 237 releases
ultimate-post / classes / options / Addons.php

Addons.php in Post Grid Gutenberg Blocks – PostX 2.4.5, at classes/options/Addons.php

221 lines 10.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace ULTP;
3
4 defined('ABSPATH') || exit;
5
6 class Options_Addons{
7 public function __construct() {
8 add_submenu_page('ultp-settings', 'Addons', 'Addons', 'manage_options', 'ultp-addons', array( $this, 'create_admin_page'), 10);
9 add_filter('ultp_settings', array($this, 'get_addon_settings'), 10, 1);
10 }
11
12
13 public static function get_addon_settings($config) {
14 $arr = array(
15 'addon' => array(
16 'label' => __('Blocks', 'ultimate-post'),
17 'attr' => array(
18 'addon_enable' => array(
19 'type' => 'heading',
20 'label' => __('Enable/Disable Blocks', 'ultimate-post'),
21 ),
22 'post_grid_1' => array(
23 'type' => 'switch',
24 'label' => __('Enable / Disable', 'ultimate-post'),
25 'default' => true,
26 'desc' => __('Post Grid #1 Block.', 'ultimate-post')
27 ),
28 'post_grid_2' => array(
29 'type' => 'switch',
30 'label' => __('Enable / Disable', 'ultimate-post'),
31 'default' => true,
32 'desc' => __('Post Grid #2 Block.', 'ultimate-post')
33 ),
34 'post_grid_3' => array(
35 'type' => 'switch',
36 'label' => __('Enable / Disable', 'ultimate-post'),
37 'default' => true,
38 'desc' => __('Post Grid #3 Block.', 'ultimate-post')
39 ),
40 'post_grid_4' => array(
41 'type' => 'switch',
42 'label' => __('Enable / Disable', 'ultimate-post'),
43 'default' => true,
44 'desc' => __('Post Grid #4 Block.', 'ultimate-post')
45 ),
46 'post_grid_5' => array(
47 'type' => 'switch',
48 'label' => __('Enable / Disable', 'ultimate-post'),
49 'default' => true,
50 'desc' => __('Post Grid #5 Block.', 'ultimate-post')
51 ),
52 'post_grid_6' => array(
53 'type' => 'switch',
54 'label' => __('Enable / Disable', 'ultimate-post'),
55 'default' => true,
56 'desc' => __('Post Grid #6 Block.', 'ultimate-post')
57 ),
58 'post_grid_7' => array(
59 'type' => 'switch',
60 'label' => __('Enable / Disable', 'ultimate-post'),
61 'default' => true,
62 'desc' => __('Post Grid #7 Block.', 'ultimate-post')
63 ),
64 'post_list_1' => array(
65 'type' => 'switch',
66 'label' => __('Enable / Disable', 'ultimate-post'),
67 'default' => true,
68 'desc' => __('Post List #1 Block.', 'ultimate-post')
69 ),
70 'post_list_2' => array(
71 'type' => 'switch',
72 'label' => __('Enable / Disable', 'ultimate-post'),
73 'default' => true,
74 'desc' => __('Post List #2 Block.', 'ultimate-post')
75 ),
76 'post_list_3' => array(
77 'type' => 'switch',
78 'label' => __('Enable / Disable', 'ultimate-post'),
79 'default' => true,
80 'desc' => __('Post List #3 Block.', 'ultimate-post')
81 ),
82 'post_list_4' => array(
83 'type' => 'switch',
84 'label' => __('Enable / Disable', 'ultimate-post'),
85 'default' => true,
86 'desc' => __('Post List #4 Block.', 'ultimate-post')
87 ),
88 'post_module_1' => array(
89 'type' => 'switch',
90 'label' => __('Enable / Disable', 'ultimate-post'),
91 'default' => true,
92 'desc' => __('Post Module #1 Block.', 'ultimate-post')
93 ),
94 'post_module_2' => array(
95 'type' => 'switch',
96 'label' => __('Enable / Disable', 'ultimate-post'),
97 'default' => true,
98 'desc' => __('Post Module #2 Block.', 'ultimate-post')
99 ),
100 'post_slider_1' => array(
101 'type' => 'switch',
102 'label' => __('Enable / Disable', 'ultimate-post'),
103 'default' => true,
104 'desc' => __('Post Slider #1 Block.', 'ultimate-post')
105 ),
106 'heading' => array(
107 'type' => 'switch',
108 'label' => __('Enable / Disable', 'ultimate-post'),
109 'default' => true,
110 'desc' => __('Heading Block.', 'ultimate-post')
111 ),
112 'image' => array(
113 'type' => 'switch',
114 'label' => __('Enable / Disable', 'ultimate-post'),
115 'default' => true,
116 'desc' => __('Image Block.', 'ultimate-post')
117 ),
118 'taxonomy' => array(
119 'type' => 'switch',
120 'label' => __('Enable / Disable', 'ultimate-post'),
121 'default' => true,
122 'desc' => __('Taxonomy Block.', 'ultimate-post')
123 ),
124 'wrapper' => array(
125 'type' => 'switch',
126 'label' => __('Enable / Disable', 'ultimate-post'),
127 'default' => true,
128 'desc' => __('Wrapper Block.', 'ultimate-post')
129 ),
130 )
131 )
132 );
133 return array_merge($config, $arr);
134 }
135
136
137 public static function all_addons(){
138 $all_addons = array(
139 'ultp_category' => array(
140 'name' => __( 'Category', 'ultimate-post' ),
141 'desc' => __( 'Choose your desired color and Image for categories or any taxonomy.', 'ultimate-post' ),
142 'img' => ULTP_URL.'/assets/img/addons/category-style.svg',
143 'is_pro' => true
144 ),
145 'ultp_builder' => array(
146 'name' => __( 'Builder', 'ultimate-post' ),
147 'desc' => __( 'Design template for Archive, Category, Custom Taxonomy, Date and Search page.', 'ultimate-post' ),
148 'img' => ULTP_URL.'/assets/img/addons/builder-icon.svg',
149 'is_pro' => true
150 ),
151 'ultp_yoast' => array(
152 'name' => __( 'Yoast Meta', 'ultimate-post' ),
153 'desc' => __( 'Show Yoast meta description in excerpt.', 'ultimate-post' ),
154 'img' => ULTP_URL.'/assets/img/addons/yoast.svg',
155 'is_pro' => true
156 ),
157 'ultp_aioseo' => array(
158 'name' => __( 'All in One SEO Meta', 'ultimate-post' ),
159 'desc' => __( 'Show All in One SEO meta description in excerpt.', 'ultimate-post' ),
160 'img' => ULTP_URL.'/assets/img/addons/aioseo.svg',
161 'is_pro' => true
162 ),
163 'ultp_rankmath' => array(
164 'name' => __( 'RankMath Meta', 'ultimate-post' ),
165 'desc' => __( 'Show RankMath meta description in excerpt.', 'ultimate-post' ),
166 'img' => ULTP_URL.'/assets/img/addons/rankmath.svg',
167 'is_pro' => true
168 ),
169 );
170 return apply_filters('ultp_addons_config', $all_addons);
171 }
172
173 /**
174 * Settings page output
175 */
176 public function create_admin_page() { ?>
177 <style>
178 .style-css{
179 background-color: #f2f2f2;
180 -webkit-font-smoothing: subpixel-antialiased;
181 }
182 </style>
183
184 <div class="ultp-option-body">
185
186 <?php require_once ULTP_PATH . 'classes/options/Heading.php'; ?>
187
188 <div class="ultp-content-wrap ultp-addons-wrap">
189 <div class="ultp-text-center"><h2 class="ultp-admin-title"><?php _e('All Addons', 'ultimate-post'); ?></h2></div>
190 <div class="ultp-addons-items">
191 <?php
192 $option_value = ultimate_post()->get_setting();
193 $addons_data = self::all_addons();
194 foreach ($addons_data as $key => $val) {
195 echo '<div class="ultp-addons-item ultp-admin-card">';
196 echo '<div class="ultp-addons-item-content">';
197 echo '<img src="'.$val['img'].'" />';
198 echo '<h4>'.$val['name'].'</h4>';
199 echo '<div class="ultp-addons-desc">'.$val['desc'].'</div>';
200 echo '</div>';
201 if( $val['is_pro'] && !defined('ULTP_PRO_VER') ){
202 echo '<div class="ultp-addons-btn">';
203 echo '<a class="ultp-btn ultp-btn-default" target="_blank" href="'.ultimate_post()->get_premium_link().'">'.__("Get Pro", "ultimate-post").'</a>';
204 echo '</div>';
205 } else {
206 echo '<div class="ultp-addons-btn">';
207 echo '<label class="ultp-switch">';
208 echo '<input class="ultp-addons-enable" '.(($val['is_pro'] && (!defined('ULTP_PRO_VER'))) ? 'disabled' : '').' data-addon="'.$key.'" type="checkbox" '.( isset($option_value[$key]) && $option_value[$key] == 'true' ? 'checked' : '' ).'>';
209 echo '<span class="ultp-slider ultp-round"></span>';
210 echo '</label>';
211 echo '</div>';
212 }
213 echo '</div>';
214 }
215 ?>
216 </div>
217 </div>
218 </div>
219
220 <?php }
221 }