1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Popular posts theme-specific functionality. |
4
|
|
|
* |
5
|
|
|
* @package MonsterInsights |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* Class MonsterInsights_Popular_Posts_Themes |
10
|
|
|
*/ |
11
|
|
|
class MonsterInsights_Popular_Posts_Themes { |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* The type of widget to load themes for (inline, widget, products). |
15
|
|
|
* |
16
|
|
|
* @var string |
17
|
|
|
*/ |
18
|
|
|
public $type; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* Holds the array of themes specific to the current type loaded. |
22
|
|
|
* |
23
|
|
|
* @var array |
24
|
|
|
*/ |
25
|
|
|
public $themes = array(); |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* Holds the data for the currently selected theme (if indicated in the constructor). |
29
|
|
|
* |
30
|
|
|
* @var array |
31
|
|
|
*/ |
32
|
|
|
public $theme = array(); |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* The current theme instance with styles from settings applied. |
36
|
|
|
* |
37
|
|
|
* @var array |
38
|
|
|
*/ |
39
|
|
|
public $styled_theme; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* The theme options key used to store specific theme styles. |
43
|
|
|
* |
44
|
|
|
* @var string |
45
|
|
|
*/ |
46
|
|
|
private $themes_styles_key = 'monsterinsights_popular_posts_theme_settings'; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* Variable for the theme settings. |
50
|
|
|
* |
51
|
|
|
* @var array |
52
|
|
|
*/ |
53
|
|
|
private $themes_styles; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* MonsterInsights_Popular_Posts_Themes constructor. |
57
|
|
|
* |
58
|
|
|
* @param string $type The type of widget: inline/widget/products. |
59
|
|
|
* @param string $theme The current theme to load details for. |
60
|
|
|
*/ |
61
|
|
|
public function __construct( $type = 'inline', $theme = '' ) { |
62
|
|
|
|
63
|
|
|
$this->type = $type; |
64
|
|
|
if ( method_exists( $this, 'get_themes_' . $type ) ) { |
65
|
|
|
$this->themes = call_user_func( array( $this, 'get_themes_' . $type ) ); |
66
|
|
|
if ( ! empty( $theme ) ) { |
67
|
|
|
$this->theme = isset( $this->themes[ $theme ] ) ? $this->themes[ $theme ] : array(); |
68
|
|
|
|
69
|
|
|
return $this->theme; |
70
|
|
|
} else { |
71
|
|
|
return $this->themes; |
72
|
|
|
} |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
return false; |
76
|
|
|
|
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* Get the current theme details with the option to load properties already styled. |
81
|
|
|
* |
82
|
|
|
* @return array|mixed |
83
|
|
|
*/ |
84
|
|
|
public function get_theme() { |
85
|
|
|
|
86
|
|
|
return $this->theme; |
87
|
|
|
|
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* Get the currently loaded themes for the widget type. |
92
|
|
|
* |
93
|
|
|
* @return array|mixed |
94
|
|
|
*/ |
95
|
|
|
public function get_themes() { |
96
|
|
|
return $this->themes; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
public function get_theme_stored_styles() { |
100
|
|
|
if ( ! isset( $this->themes_styles ) ) { |
101
|
|
|
$this->themes_styles = get_option( $this->themes_styles_key, array() ); |
|
|
|
|
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
return $this->themes_styles; |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* Go through the themes and apply styles from the stored settings. |
109
|
|
|
* |
110
|
|
|
* @var string $type The instance type: inline/widget/products. |
111
|
|
|
* @var array $themes The themes to process/apply styles for. |
112
|
|
|
*/ |
113
|
|
|
public function process_themes_styles( $type, $themes ) { |
114
|
|
|
|
115
|
|
|
$settings = $this->get_theme_stored_styles(); |
116
|
|
|
|
117
|
|
|
if ( ! empty( $settings[ $type ] ) ) { |
118
|
|
|
foreach ( $themes as $theme_key => $theme_values ) { |
119
|
|
|
if ( ! empty( $settings[ $type ][ $theme_key ] ) ) { |
120
|
|
|
foreach ( $themes[ $theme_key ]['styles'] as $object => $props ) { |
121
|
|
|
if ( ! empty( $settings[ $type ][ $theme_key ][ $object ] ) ) { |
122
|
|
|
foreach ( $props as $style_key => $style_value ) { |
123
|
|
|
if ( ! empty( $settings[ $type ][ $theme_key ][ $object ][ $style_key ] ) ) { |
124
|
|
|
$themes[ $theme_key ]['styles'][ $object ][ $style_key ] = $settings[ $type ][ $theme_key ][ $object ][ $style_key ]; |
125
|
|
|
} |
126
|
|
|
} |
127
|
|
|
} |
128
|
|
|
} |
129
|
|
|
} |
130
|
|
|
} |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
return $themes; |
134
|
|
|
|
135
|
|
|
} |
136
|
|
|
|
137
|
|
|
/** |
138
|
|
|
* Get the themes for the inline widget type. |
139
|
|
|
* |
140
|
|
|
* @return array |
141
|
|
|
*/ |
142
|
|
|
public function get_themes_inline() { |
143
|
|
|
|
144
|
|
|
$themes = array( |
145
|
|
|
'alpha' => array( |
146
|
|
|
'label' => 'Alpha', |
147
|
|
|
'styles' => array( |
148
|
|
|
'title' => array( |
149
|
|
|
'color' => '#393F4C', |
150
|
|
|
'size' => 18, |
151
|
|
|
'text' => '15 Proven Ways to Repurpose Content on Your WordPress Site', |
152
|
|
|
), |
153
|
|
|
'label' => array( |
154
|
|
|
'color' => '#EB5757', |
155
|
|
|
'text' => 'Trending', |
156
|
|
|
), |
157
|
|
|
'background' => array( |
158
|
|
|
'color' => '#F0F2F4', |
159
|
|
|
), |
160
|
|
|
), |
161
|
|
|
'level' => 'lite', |
162
|
|
|
), |
163
|
|
|
'beta' => array( |
164
|
|
|
'label' => 'Beta', |
165
|
|
|
'styles' => array( |
166
|
|
|
'title' => array( |
167
|
|
|
'color' => '#393F4C', |
168
|
|
|
'size' => 18, |
169
|
|
|
'text' => 'How to Use Google Trends to Boost Traffic and Sales (9 Simple Ways)', |
170
|
|
|
), |
171
|
|
|
'label' => array( |
172
|
|
|
'color' => '#EB5757', |
173
|
|
|
'text' => 'Trending', |
174
|
|
|
), |
175
|
|
|
'background' => array( |
176
|
|
|
'border' => '#F0F2F4', |
177
|
|
|
), |
178
|
|
|
'image' => 'theme-preview-beta.png', |
179
|
|
|
), |
180
|
|
|
'image' => true, |
181
|
|
|
'level' => 'lite', |
182
|
|
|
), |
183
|
|
|
'charlie' => array( |
184
|
|
|
'label' => 'Charlie', |
185
|
|
|
'styles' => array( |
186
|
|
|
'title' => array( |
187
|
|
|
'color' => '#393f4c', |
188
|
|
|
'size' => 16, |
189
|
|
|
), |
190
|
|
|
'label' => array( |
191
|
|
|
'color' => '#393f4c', |
192
|
|
|
'text' => 'Popular Stories Right now', |
193
|
|
|
), |
194
|
|
|
'border' => array( |
195
|
|
|
'color' => '#D3D7DE', |
196
|
|
|
), |
197
|
|
|
), |
198
|
|
|
'list' => array( |
199
|
|
|
'15 Proven Ways to Repurpose Content on Your WordPress Site', |
200
|
|
|
'How to Use Google Trends to Boost Traffic and Sales (9 Simple Ways)', |
201
|
|
|
'How to Set Up Online Ordering for Your Restaurant Website', |
202
|
|
|
), |
203
|
|
|
'posts' => 3, |
204
|
|
|
'level' => 'lite', |
205
|
|
|
), |
206
|
|
|
'delta' => array( |
207
|
|
|
'label' => 'Delta', |
208
|
|
|
'styles' => array( |
209
|
|
|
'icon' => array( |
210
|
|
|
'color' => '#EB5757', |
211
|
|
|
), |
212
|
|
|
'title' => array( |
213
|
|
|
'color' => '#393f4c', |
214
|
|
|
'size' => 16, |
215
|
|
|
'text' => 'How to Use Google Trends to Boost Traffic and Sales (9 Simple Ways)', |
216
|
|
|
), |
217
|
|
|
'label' => array( |
218
|
|
|
'color' => '#EB5757', |
219
|
|
|
'text' => 'Trending', |
220
|
|
|
), |
221
|
|
|
'background' => array( |
222
|
|
|
'border' => '#F0F2F4', |
223
|
|
|
), |
224
|
|
|
), |
225
|
|
|
'level' => 'plus', |
226
|
|
|
), |
227
|
|
|
'echo' => array( |
228
|
|
|
'label' => 'Echo', |
229
|
|
|
'styles' => array( |
230
|
|
|
'title' => array( |
231
|
|
|
'color' => '#393f4c', |
232
|
|
|
'size' => 18, |
233
|
|
|
'text' => '15 Proven Ways to Repurpose Content on Your WordPress Site', |
234
|
|
|
), |
235
|
|
|
'label' => array( |
236
|
|
|
'color' => '#EB5757', |
237
|
|
|
'text' => 'Trending:', |
238
|
|
|
), |
239
|
|
|
'background' => array( |
240
|
|
|
'color' => '#F0F2F4', |
241
|
|
|
), |
242
|
|
|
), |
243
|
|
|
'level' => 'plus', |
244
|
|
|
), |
245
|
|
|
'foxtrot' => array( |
246
|
|
|
'label' => 'Foxtrot', |
247
|
|
|
'styles' => array( |
248
|
|
|
'title' => array( |
249
|
|
|
'color' => '#393f4c', |
250
|
|
|
'size' => 18, |
251
|
|
|
'text' => 'How to Build an Email List in WordPress – Email Marketing 101', |
252
|
|
|
), |
253
|
|
|
'label' => array( |
254
|
|
|
'color' => '#EB5757', |
255
|
|
|
'text' => 'Trending', |
256
|
|
|
), |
257
|
|
|
'image' => 'theme-preview-image.jpg', |
258
|
|
|
), |
259
|
|
|
'image' => true, |
260
|
|
|
'level' => 'plus', |
261
|
|
|
), |
262
|
|
|
'golf' => array( |
263
|
|
|
'label' => 'Golf', |
264
|
|
|
'styles' => array( |
265
|
|
|
'title' => array( |
266
|
|
|
'color' => '#393f4c', |
267
|
|
|
'size' => 16, |
268
|
|
|
'text' => '15 Proven Ways to Repurpose Content on Your WordPress Site', |
269
|
|
|
), |
270
|
|
|
'label' => array( |
271
|
|
|
'color' => '#EB5757', |
272
|
|
|
'text' => 'Popular now', |
273
|
|
|
), |
274
|
|
|
'border' => array( |
275
|
|
|
'color' => '#EB5757', |
276
|
|
|
'color2' => '#E2E4E9', |
277
|
|
|
), |
278
|
|
|
), |
279
|
|
|
'level' => 'plus', |
280
|
|
|
), |
281
|
|
|
'hotel' => array( |
282
|
|
|
'label' => 'Hotel', |
283
|
|
|
'styles' => array( |
284
|
|
|
'title' => array( |
285
|
|
|
'color' => '#393f4c', |
286
|
|
|
'size' => 18, |
287
|
|
|
'text' => 'How to Use Google Trends to Boost Traffic and Sales (9 Simple Ways)', |
288
|
|
|
), |
289
|
|
|
'icon' => array( |
290
|
|
|
'color' => '#EB5757', |
291
|
|
|
), |
292
|
|
|
), |
293
|
|
|
'level' => 'plus', |
294
|
|
|
), |
295
|
|
|
'india' => array( |
296
|
|
|
'label' => 'India', |
297
|
|
|
'styles' => array( |
298
|
|
|
'title' => array( |
299
|
|
|
'color' => '#393f4c', |
300
|
|
|
'size' => 14, |
301
|
|
|
'text' => 'How to Use Google Trends to Boost Traffic and Sales (9 Simple Ways)', |
302
|
|
|
), |
303
|
|
|
'label' => array( |
304
|
|
|
'color' => '#EB5757', |
305
|
|
|
'text' => 'Trending:', |
306
|
|
|
), |
307
|
|
|
'border' => array( |
308
|
|
|
'color' => '#EB5757', |
309
|
|
|
), |
310
|
|
|
'background' => array( |
311
|
|
|
'color' => '#f0f2f4', |
312
|
|
|
), |
313
|
|
|
), |
314
|
|
|
'level' => 'plus', |
315
|
|
|
), |
316
|
|
|
'juliett' => array( |
317
|
|
|
'label' => 'Juliett', |
318
|
|
|
'styles' => array( |
319
|
|
|
'title' => array( |
320
|
|
|
'color' => '#393f4c', |
321
|
|
|
'size' => 18, |
322
|
|
|
'text' => 'How to Build an Email List in WordPress – Email Marketing 101', |
323
|
|
|
), |
324
|
|
|
'label' => array( |
325
|
|
|
'color' => '#393f4c', |
326
|
|
|
'background' => '#e2e4e9', |
327
|
|
|
'text' => 'Trending', |
328
|
|
|
), |
329
|
|
|
'border' => array( |
330
|
|
|
'color' => '#e2e4e9', |
331
|
|
|
), |
332
|
|
|
), |
333
|
|
|
'image' => true, |
334
|
|
|
'level' => 'plus', |
335
|
|
|
), |
336
|
|
|
'kilo' => array( |
337
|
|
|
'label' => 'Kilo', |
338
|
|
|
'styles' => array( |
339
|
|
|
'title' => array( |
340
|
|
|
'color' => '#393f4c', |
341
|
|
|
'size' => 18, |
342
|
|
|
'text' => 'How to Use Google Trends to Boost Traffic and Sales (9 Simple Ways)', |
343
|
|
|
), |
344
|
|
|
'label' => array( |
345
|
|
|
'color' => '#EB5757', |
346
|
|
|
'text' => 'Popular now', |
347
|
|
|
), |
348
|
|
|
'border' => array( |
349
|
|
|
'color' => '#e2e4e9', |
350
|
|
|
'color2' => '#e2e4e9', |
351
|
|
|
), |
352
|
|
|
), |
353
|
|
|
'level' => 'plus', |
354
|
|
|
), |
355
|
|
|
'lima' => array( |
356
|
|
|
'label' => 'Lima', |
357
|
|
|
'styles' => array( |
358
|
|
|
'title' => array( |
359
|
|
|
'color' => '#393f4c', |
360
|
|
|
'size' => 18, |
361
|
|
|
'text' => '15 Proven Ways to Repurpose Content on Your WordPress Site', |
362
|
|
|
), |
363
|
|
|
'label' => array( |
364
|
|
|
'color' => '#EB5757', |
365
|
|
|
'text' => 'Trending', |
366
|
|
|
), |
367
|
|
|
'background' => array( |
368
|
|
|
'color' => '#f0f2f4', |
369
|
|
|
), |
370
|
|
|
'image' => 'theme-preview-image-2.jpg', |
371
|
|
|
), |
372
|
|
|
'image' => true, |
373
|
|
|
'level' => 'plus', |
374
|
|
|
), |
375
|
|
|
'mike' => array( |
376
|
|
|
'label' => 'Mike', |
377
|
|
|
'styles' => array( |
378
|
|
|
'title' => array( |
379
|
|
|
'color' => '#393f4c', |
380
|
|
|
'size' => 18, |
381
|
|
|
'text' => 'How to Build an Email List in WordPress – Email Marketing 101', |
382
|
|
|
), |
383
|
|
|
'label' => array( |
384
|
|
|
'color' => '#fff', |
385
|
|
|
'background' => '#f2994a', |
386
|
|
|
'text' => 'Trending', |
387
|
|
|
), |
388
|
|
|
'background' => array( |
389
|
|
|
'color' => '#f0f2f4', |
390
|
|
|
), |
391
|
|
|
'image' => 'theme-preview-image.jpg', |
392
|
|
|
), |
393
|
|
|
'image' => true, |
394
|
|
|
'level' => 'plus', |
395
|
|
|
), |
396
|
|
|
'november' => array( |
397
|
|
|
'label' => 'November', |
398
|
|
|
'styles' => array( |
399
|
|
|
'title' => array( |
400
|
|
|
'color' => '#393f4c', |
401
|
|
|
'size' => 16, |
402
|
|
|
'text' => 'How to Use Google Trends to Boost Traffic and Sales (9 Simple Ways)', |
403
|
|
|
), |
404
|
|
|
'label' => array( |
405
|
|
|
'color' => '#eb5757', |
406
|
|
|
'text' => 'Trending', |
407
|
|
|
), |
408
|
|
|
'background' => array( |
409
|
|
|
'border' => '#f0f2f4', |
410
|
|
|
), |
411
|
|
|
'icon' => array( |
412
|
|
|
'background' => '#eb5757', |
413
|
|
|
'color' => '#fff', |
414
|
|
|
), |
415
|
|
|
), |
416
|
|
|
'level' => 'plus', |
417
|
|
|
), |
418
|
|
|
); |
419
|
|
|
|
420
|
|
|
return $this->process_themes_styles( 'inline', $themes ); |
421
|
|
|
|
422
|
|
|
} |
423
|
|
|
|
424
|
|
|
/** |
425
|
|
|
* Get the themese for the widget instance. |
426
|
|
|
* |
427
|
|
|
* @return array |
428
|
|
|
*/ |
429
|
|
|
public function get_themes_widget() { |
430
|
|
|
|
431
|
|
|
$themes = array( |
432
|
|
|
'alpha' => array( |
433
|
|
|
'label' => 'Alpha', |
434
|
|
|
'styles' => array( |
435
|
|
|
'title' => array( |
436
|
|
|
'color' => '#393F4C', |
437
|
|
|
'size' => 16, |
438
|
|
|
), |
439
|
|
|
'background' => array( |
440
|
|
|
'color' => '#F0F2F4', |
441
|
|
|
), |
442
|
|
|
|
443
|
|
|
), |
444
|
|
|
'list' => array( |
445
|
|
|
'items' => array( |
446
|
|
|
'How to Set Up WordPress User Activity Tracking in 3 Easy Steps', |
447
|
|
|
'How to Share Your Google Analytics Reports with Others (5 Easy Ways)', |
448
|
|
|
'12 Best Social Media Analytics Tools for Marketers (Tried & Tested)', |
449
|
|
|
'9 Proven Ways to Get Google to Index Your Website Right Away', |
450
|
|
|
), |
451
|
|
|
), |
452
|
|
|
'level' => 'lite', |
453
|
|
|
), |
454
|
|
|
'beta' => array( |
455
|
|
|
'label' => 'Beta', |
456
|
|
|
'styles' => array( |
457
|
|
|
'title' => array( |
458
|
|
|
'color' => '#393F4C', |
459
|
|
|
'size' => 16, |
460
|
|
|
), |
461
|
|
|
'background' => array( |
462
|
|
|
'border' => '#1EC185', |
463
|
|
|
), |
464
|
|
|
), |
465
|
|
|
'list' => array( |
466
|
|
|
'items' => array( |
467
|
|
|
'9 Proven Ways to Get Google to Index Your Website Right Away', |
468
|
|
|
'How to Share Your Google Analytics Reports with Others (5 Easy Ways)', |
469
|
|
|
'12 Best Social Media Analytics Tools for Marketers (Tried & Tested)', |
470
|
|
|
'Uncover How Much Traffic Does a Website Get (5 Effortless Ways)', |
471
|
|
|
), |
472
|
|
|
), |
473
|
|
|
'level' => 'lite', |
474
|
|
|
), |
475
|
|
|
'charlie' => array( |
476
|
|
|
'label' => 'Charlie', |
477
|
|
|
'styles' => array( |
478
|
|
|
'title' => array( |
479
|
|
|
'color' => '#393f4c', |
480
|
|
|
'size' => 16, |
481
|
|
|
), |
482
|
|
|
'background' => array( |
483
|
|
|
'color' => '#F0F2F4', |
484
|
|
|
'border' => '#338EEF', |
485
|
|
|
), |
486
|
|
|
), |
487
|
|
|
'list' => array( |
488
|
|
|
'items' => array( |
489
|
|
|
'Uncover How Much Traffic Does a Website Get (5 Effortless Ways)', |
490
|
|
|
'How to Share Your Google Analytics Reports with Others (5 Easy Ways)', |
491
|
|
|
'12 Best Social Media Analytics Tools for Marketers (Tried & Tested)', |
492
|
|
|
'9 Proven Ways to Get Google to Index Your Website Right Away', |
493
|
|
|
), |
494
|
|
|
), |
495
|
|
|
'level' => 'lite', |
496
|
|
|
), |
497
|
|
|
'delta' => array( |
498
|
|
|
'label' => 'Delta', |
499
|
|
|
'styles' => array( |
500
|
|
|
'title' => array( |
501
|
|
|
'color' => '#393f4c', |
502
|
|
|
'size' => 18, |
503
|
|
|
), |
504
|
|
|
'background' => array( |
505
|
|
|
'border' => '#D3D7DE', |
506
|
|
|
), |
507
|
|
|
'meta' => array( |
508
|
|
|
'color' => '#99A1B3', |
509
|
|
|
'author' => 'on', |
510
|
|
|
'date' => 'on', |
511
|
|
|
'separator' => '●', |
512
|
|
|
), |
513
|
|
|
), |
514
|
|
|
'list' => array( |
515
|
|
|
'items' => array( |
516
|
|
|
'9 Proven Ways to Get Google to Index Your Website Right Away', |
517
|
|
|
'How to Share Your Google Analytics Reports with Others (5 Easy Ways)', |
518
|
|
|
'12 Best Social Media Analytics Tools for Marketers (Tried & Tested)', |
519
|
|
|
'Uncover How Much Traffic Does a Website Get (5 Effortless Ways)', |
520
|
|
|
), |
521
|
|
|
'images' => array( |
522
|
|
|
'theme-widget-1.jpg', |
523
|
|
|
'theme-widget-2.jpg', |
524
|
|
|
'theme-widget-3.jpg', |
525
|
|
|
'theme-widget-4.jpg', |
526
|
|
|
), |
527
|
|
|
), |
528
|
|
|
'image' => true, |
529
|
|
|
'level' => 'pro', |
530
|
|
|
), |
531
|
|
|
'echo' => array( |
532
|
|
|
'label' => 'Echo', |
533
|
|
|
'styles' => array( |
534
|
|
|
'title' => array( |
535
|
|
|
'color' => '#393f4c', |
536
|
|
|
'size' => 16, |
537
|
|
|
), |
538
|
|
|
'meta' => array( |
539
|
|
|
'color' => '#99A1B3', |
540
|
|
|
'size' => 12, |
541
|
|
|
'author' => 'on', |
542
|
|
|
'date' => 'on', |
543
|
|
|
'comments' => 'on', |
544
|
|
|
'separator' => 'on', |
545
|
|
|
), |
546
|
|
|
'comments' => array( |
547
|
|
|
'color' => '#393F4C', |
548
|
|
|
), |
549
|
|
|
), |
550
|
|
|
'list' => array( |
551
|
|
|
'items' => array( |
552
|
|
|
'9 Proven Ways to Get Google to Index Your Website Right Away', |
553
|
|
|
'How to Share Your Google Analytics Reports with Others (5 Easy Ways)', |
554
|
|
|
'12 Best Social Media Analytics Tools for Marketers (Tried & Tested)', |
555
|
|
|
'Uncover How Much Traffic Does a Website Get (5 Effortless Ways)', |
556
|
|
|
), |
557
|
|
|
'images' => array( |
558
|
|
|
'theme-widget-5.jpg', |
559
|
|
|
'theme-widget-5.jpg', |
560
|
|
|
'theme-widget-5.jpg', |
561
|
|
|
'theme-widget-5.jpg', |
562
|
|
|
), |
563
|
|
|
), |
564
|
|
|
'image' => true, |
565
|
|
|
'level' => 'pro', |
566
|
|
|
), |
567
|
|
|
'foxtrot' => array( |
568
|
|
|
'label' => 'Foxtrot', |
569
|
|
|
'styles' => array( |
570
|
|
|
'title' => array( |
571
|
|
|
'color' => '#393f4c', |
572
|
|
|
'size' => 16, |
573
|
|
|
), |
574
|
|
|
'meta' => array( |
575
|
|
|
'color' => '#99A1B3', |
576
|
|
|
'size' => 12, |
577
|
|
|
'author' => 'on', |
578
|
|
|
'date' => 'on', |
579
|
|
|
'comments' => 'on', |
580
|
|
|
'separator' => '|', |
581
|
|
|
), |
582
|
|
|
'comments' => array( |
583
|
|
|
'color' => '#393F4C', |
584
|
|
|
), |
585
|
|
|
), |
586
|
|
|
'list' => array( |
587
|
|
|
'items' => array( |
588
|
|
|
'9 Proven Ways to Get Google to Index Your Website Right Away', |
589
|
|
|
'12 Best Social Media Analytics Tools for Marketers (Tried & Tested) ', |
590
|
|
|
'Uncover How Much Traffic Does a Website Get (5 Effortless Ways)', |
591
|
|
|
'How to Share Your Google Analytics Reports with Others (5 Easy Ways)', |
592
|
|
|
), |
593
|
|
|
), |
594
|
|
|
'level' => 'pro', |
595
|
|
|
), |
596
|
|
|
'golf' => array( |
597
|
|
|
'label' => 'Golf', |
598
|
|
|
'styles' => array( |
599
|
|
|
'title' => array( |
600
|
|
|
'color' => '#393f4c', |
601
|
|
|
'size' => 16, |
602
|
|
|
), |
603
|
|
|
'label' => array( |
604
|
|
|
'color' => '#fff', |
605
|
|
|
'background' => '#EB5757', |
606
|
|
|
'text' => 'Trending:', |
607
|
|
|
'editable' => true, |
608
|
|
|
), |
609
|
|
|
'meta' => array( |
610
|
|
|
'color' => '#99A1B3', |
611
|
|
|
'size' => 12, |
612
|
|
|
'author' => 'on', |
613
|
|
|
'date' => 'on', |
614
|
|
|
'comments' => 'on', |
615
|
|
|
'separator' => '|', |
616
|
|
|
), |
617
|
|
|
'comments' => array( |
618
|
|
|
'color' => '#393F4C', |
619
|
|
|
), |
620
|
|
|
), |
621
|
|
|
'list' => array( |
622
|
|
|
'items' => array( |
623
|
|
|
'9 Proven Ways to Get Google to Index Your Website Right Away', |
624
|
|
|
'12 Best Social Media Analytics Tools for Marketers (Tried & Tested) ', |
625
|
|
|
'Uncover How Much Traffic Does a Website Get (5 Effortless Ways)', |
626
|
|
|
'How to Share Your Google Analytics Reports with Others (5 Easy Ways)', |
627
|
|
|
), |
628
|
|
|
), |
629
|
|
|
'level' => 'pro', |
630
|
|
|
), |
631
|
|
|
'hotel' => array( |
632
|
|
|
'label' => 'Hotel', |
633
|
|
|
'styles' => array( |
634
|
|
|
'title' => array( |
635
|
|
|
'color' => '#fff', |
636
|
|
|
'size' => 16, |
637
|
|
|
), |
638
|
|
|
'meta' => array( |
639
|
|
|
'color' => '#fff', |
640
|
|
|
'size' => 12, |
641
|
|
|
'author' => 'on', |
642
|
|
|
'date' => 'on', |
643
|
|
|
), |
644
|
|
|
), |
645
|
|
|
'list' => array( |
646
|
|
|
'items' => array( |
647
|
|
|
'How to Allow WordPress to Upload All File Types (The Easy Way)', |
648
|
|
|
'14 Handy Google Search Operators for SEO (A Complete List)', |
649
|
|
|
'How to Write Irresistible Meta Descriptions for SEO & More Clicks?', |
650
|
|
|
'Uncover How Much Traffic Does a Website Get (5 Effortless Ways)', |
651
|
|
|
), |
652
|
|
|
'images' => array( |
653
|
|
|
'theme-widget-5.jpg', |
654
|
|
|
'theme-widget-6.jpg', |
655
|
|
|
'theme-widget-7.jpg', |
656
|
|
|
'theme-widget-8.jpg', |
657
|
|
|
), |
658
|
|
|
), |
659
|
|
|
'image' => true, |
660
|
|
|
'level' => 'pro', |
661
|
|
|
), |
662
|
|
|
); |
663
|
|
|
|
664
|
|
|
return $this->process_themes_styles( 'widget', $themes ); |
665
|
|
|
|
666
|
|
|
} |
667
|
|
|
|
668
|
|
|
/** |
669
|
|
|
* Get the themes for the products widget. |
670
|
|
|
* |
671
|
|
|
* @return array |
672
|
|
|
*/ |
673
|
|
|
public function get_themes_products() { |
674
|
|
|
$themes = array( |
675
|
|
|
'alpha' => array( |
676
|
|
|
'label' => 'Alpha', |
677
|
|
|
'styles' => array( |
678
|
|
|
'title' => array( |
679
|
|
|
'color' => '#393F4C', |
680
|
|
|
'size' => 16, |
681
|
|
|
), |
682
|
|
|
'background' => array( |
683
|
|
|
'border' => '#d3d7de', |
684
|
|
|
), |
685
|
|
|
'price' => array( |
686
|
|
|
'color' => '#393F4C', |
687
|
|
|
'size' => 12, |
688
|
|
|
), |
689
|
|
|
'rating' => array( |
690
|
|
|
'color' => '#EB5757', |
691
|
|
|
), |
692
|
|
|
'meta' => array( |
693
|
|
|
'price' => 'on', |
694
|
|
|
'rating' => 'on', |
695
|
|
|
'image' => 'on', |
696
|
|
|
), |
697
|
|
|
), |
698
|
|
|
'list' => array( |
699
|
|
|
'items' => array( |
700
|
|
|
'WPBeginner 10-Year Anniversary Gray T-Shirt', |
701
|
|
|
'WPForms Small White Logo T-Shirt', |
702
|
|
|
'OptinMonster White Text Color Mascot T-Shirt', |
703
|
|
|
'WPForms Make Things Simple Gray T-Shirt', |
704
|
|
|
), |
705
|
|
|
'images' => array( |
706
|
|
|
'theme-products-1.jpg', |
707
|
|
|
'theme-products-2.jpg', |
708
|
|
|
'theme-products-3.jpg', |
709
|
|
|
'theme-products-4.jpg', |
710
|
|
|
), |
711
|
|
|
'prices' => array( |
712
|
|
|
'$59.99', |
713
|
|
|
'$28.00', |
714
|
|
|
'$65.00', |
715
|
|
|
'$59.50', |
716
|
|
|
), |
717
|
|
|
), |
718
|
|
|
), |
719
|
|
|
'beta' => array( |
720
|
|
|
'label' => 'Beta', |
721
|
|
|
'styles' => array( |
722
|
|
|
'title' => array( |
723
|
|
|
'color' => '#393F4C', |
724
|
|
|
'size' => 16, |
725
|
|
|
), |
726
|
|
|
'background' => array( |
727
|
|
|
'color' => '#F0F2F4', |
728
|
|
|
), |
729
|
|
|
'price' => array( |
730
|
|
|
'color' => '#4C5566', |
731
|
|
|
'size' => 12, |
732
|
|
|
), |
733
|
|
|
'rating' => array( |
734
|
|
|
'color' => '#F2D74A', |
735
|
|
|
), |
736
|
|
|
'meta' => array( |
737
|
|
|
'price' => 'on', |
738
|
|
|
'rating' => 'on', |
739
|
|
|
'image' => 'on', |
740
|
|
|
), |
741
|
|
|
), |
742
|
|
|
'list' => array( |
743
|
|
|
'items' => array( |
744
|
|
|
'Admin WPBeginner Black T-Shirt', |
745
|
|
|
'Black WP Beginner logo T-Shirt', |
746
|
|
|
'Technically Awesome Groovy White T-Shirt', |
747
|
|
|
'Technically Awesome Code Comment Black T-Shirt', |
748
|
|
|
), |
749
|
|
|
'images' => array( |
750
|
|
|
'theme-products-5.jpg', |
751
|
|
|
'theme-products-7.jpg', |
752
|
|
|
'theme-products-6.jpg', |
753
|
|
|
'theme-products-8.jpg', |
754
|
|
|
), |
755
|
|
|
'prices' => array( |
756
|
|
|
'$29.50', |
757
|
|
|
'$28.00', |
758
|
|
|
'$65.00', |
759
|
|
|
'$59.50', |
760
|
|
|
), |
761
|
|
|
), |
762
|
|
|
), |
763
|
|
|
'charlie' => array( |
764
|
|
|
'label' => 'Charlie', |
765
|
|
|
'styles' => array( |
766
|
|
|
'title' => array( |
767
|
|
|
'color' => '#fff', |
768
|
|
|
'size' => 16, |
769
|
|
|
), |
770
|
|
|
'rating' => array( |
771
|
|
|
'color' => '#F2D74A', |
772
|
|
|
), |
773
|
|
|
'price' => array( |
774
|
|
|
'color' => '#fff', |
775
|
|
|
'size' => 12, |
776
|
|
|
), |
777
|
|
|
'meta' => array( |
778
|
|
|
'price' => 'on', |
779
|
|
|
'rating' => 'on', |
780
|
|
|
), |
781
|
|
|
), |
782
|
|
|
'list' => array( |
783
|
|
|
'items' => array( |
784
|
|
|
'Admin WPBeginner Black T-Shirt', |
785
|
|
|
'Black WP Beginner logo T-Shirt', |
786
|
|
|
'Technically Awesome Groovy White T-Shirt', |
787
|
|
|
'Technically Awesome Code Comment Black T-Shirt', |
788
|
|
|
), |
789
|
|
|
'images' => array( |
790
|
|
|
'theme-products-5.jpg', |
791
|
|
|
'theme-products-7.jpg', |
792
|
|
|
'theme-products-6.jpg', |
793
|
|
|
'theme-products-8.jpg', |
794
|
|
|
), |
795
|
|
|
'prices' => array( |
796
|
|
|
'$29.50', |
797
|
|
|
'$28.00', |
798
|
|
|
'$65.00', |
799
|
|
|
'$59.50', |
800
|
|
|
), |
801
|
|
|
), |
802
|
|
|
'image' => true, |
803
|
|
|
), |
804
|
|
|
'delta' => array( |
805
|
|
|
'label' => 'Delta', |
806
|
|
|
'styles' => array( |
807
|
|
|
'title' => array( |
808
|
|
|
'color' => '#393f4c', |
809
|
|
|
'size' => 14, |
810
|
|
|
), |
811
|
|
|
'rating' => array( |
812
|
|
|
'color' => '#F2D74A', |
813
|
|
|
), |
814
|
|
|
'price' => array( |
815
|
|
|
'color' => '#4C5566', |
816
|
|
|
'size' => 12, |
817
|
|
|
), |
818
|
|
|
'meta' => array( |
819
|
|
|
'price' => 'on', |
820
|
|
|
'rating' => 'on', |
821
|
|
|
'image' => 'on', |
822
|
|
|
), |
823
|
|
|
), |
824
|
|
|
'list' => array( |
825
|
|
|
'items' => array( |
826
|
|
|
'Admin WPBeginner Black T-Shirt', |
827
|
|
|
'Black WP Beginner logo T-Shirt', |
828
|
|
|
'Technically Awesome Groovy White T-Shirt', |
829
|
|
|
'Technically Awesome Code Comment Black T-Shirt', |
830
|
|
|
), |
831
|
|
|
'images' => array( |
832
|
|
|
'theme-products-5.jpg', |
833
|
|
|
'theme-products-7.jpg', |
834
|
|
|
'theme-products-6.jpg', |
835
|
|
|
'theme-products-8.jpg', |
836
|
|
|
), |
837
|
|
|
'prices' => array( |
838
|
|
|
'$29.50', |
839
|
|
|
'$28.00', |
840
|
|
|
'$65.00', |
841
|
|
|
'$59.50', |
842
|
|
|
), |
843
|
|
|
), |
844
|
|
|
), |
845
|
|
|
); |
846
|
|
|
|
847
|
|
|
return $this->process_themes_styles( 'products', $themes ); |
848
|
|
|
} |
849
|
|
|
|
850
|
|
|
} |
851
|
|
|
|
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.
For example, imagine you have a variable
$accountId
that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to theid
property of an instance of theAccount
class. This class holds a proper account, so the id value must no longer be false.Either this assignment is in error or a type check should be added for that assignment.