Version Description
- SAFE UPDATE: No data loss for those upgrading from version 3.0 or higher
- Allows automatic recovery of all pricing tables when switching to PRO version
Download this release
Release Info
Developer | spwebguy |
Plugin | Responsive Pricing Table |
Version | 3.2.1 |
Comparing to | |
See all releases |
Code changes from version 3.2 to 3.2.1
- readme.txt +4 -0
- rpt.php +579 -563
readme.txt
CHANGED
@@ -70,6 +70,10 @@ The free version of the Responsive Pricing Table plugin is **not limited** and d
|
|
70 |
|
71 |
|
72 |
== Changelog ==
|
|
|
|
|
|
|
|
|
73 |
= 3.2 =
|
74 |
* SAFE UPDATE: No data loss for those upgrading from version 3.0 or higher
|
75 |
* CSS bug fixes (icons/titles)
|
70 |
|
71 |
|
72 |
== Changelog ==
|
73 |
+
= 3.2.1 =
|
74 |
+
* SAFE UPDATE: No data loss for those upgrading from version 3.0 or higher
|
75 |
+
* Allows automatic recovery of all pricing tables when switching to PRO version
|
76 |
+
|
77 |
= 3.2 =
|
78 |
* SAFE UPDATE: No data loss for those upgrading from version 3.0 or higher
|
79 |
* CSS bug fixes (icons/titles)
|
rpt.php
CHANGED
@@ -1,564 +1,580 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Plugin Name: Responsive Pricing Table
|
4 |
-
* Plugin URI: http://wpdarko.com/darko-tools/responsive-pricing-table/
|
5 |
-
* Description: A responsive, easy and elegant way to present your offer to your visitors. Just create a new pricing table (custom type) and copy-paste the shortcode into your posts/pages. Find support and information on the <a href="http://wpdarko.com/darko-tools/responsive-pricing-table/">plugin's page</a>. This free version is NOT limited and does not contain any ad. Check out the <a href='http://wpdarko.com/darko-tools/responsive-pricing-table-pro/'>PRO version</a> for more great features.
|
6 |
-
* Version: 3.2
|
7 |
-
* Author: WP Darko
|
8 |
-
* Author URI: http://wpdarko.com
|
9 |
-
* License: GPL2
|
10 |
-
*/
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
'
|
90 |
-
'
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
'
|
95 |
-
'
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
'
|
100 |
-
'id' => $prefix . '
|
101 |
-
'type' => '
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
'
|
106 |
-
'id' => $prefix . '
|
107 |
-
'type' => '
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
'
|
112 |
-
'
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
'
|
121 |
-
'
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
),
|
126 |
-
array(
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
),
|
161 |
-
array(
|
162 |
-
'name' => '
|
163 |
-
'id' => $prefix . '
|
164 |
-
'type' => '
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
'
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
),
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
),
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
'
|
219 |
-
),
|
220 |
-
'default' => '
|
221 |
-
),
|
222 |
-
array(
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
'
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
'
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
'
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
'
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
'
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
'
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
'
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
'
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
'
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
'
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
'
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
if ($
|
360 |
-
$
|
361 |
-
} else {
|
362 |
-
$
|
363 |
-
}
|
364 |
-
|
365 |
-
$
|
366 |
-
if ($
|
367 |
-
$
|
368 |
-
} else if ($
|
369 |
-
$
|
370 |
-
} else {
|
371 |
-
$
|
372 |
-
}
|
373 |
-
|
374 |
-
$
|
375 |
-
if ($
|
376 |
-
$
|
377 |
-
} else {
|
378 |
-
$
|
379 |
-
}
|
380 |
-
|
381 |
-
$
|
382 |
-
if ($
|
383 |
-
$
|
384 |
-
} else {
|
385 |
-
$
|
386 |
-
}
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
$
|
393 |
-
}
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
$
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
$
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
$
|
531 |
-
}
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
$
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
564 |
?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Name: Responsive Pricing Table
|
4 |
+
* Plugin URI: http://wpdarko.com/darko-tools/responsive-pricing-table/
|
5 |
+
* Description: A responsive, easy and elegant way to present your offer to your visitors. Just create a new pricing table (custom type) and copy-paste the shortcode into your posts/pages. Find support and information on the <a href="http://wpdarko.com/darko-tools/responsive-pricing-table/">plugin's page</a>. This free version is NOT limited and does not contain any ad. Check out the <a href='http://wpdarko.com/darko-tools/responsive-pricing-table-pro/'>PRO version</a> for more great features.
|
6 |
+
* Version: 3.2.1
|
7 |
+
* Author: WP Darko
|
8 |
+
* Author URI: http://wpdarko.com
|
9 |
+
* License: GPL2
|
10 |
+
*/
|
11 |
+
|
12 |
+
function free_pro_check() {
|
13 |
+
if (is_plugin_active('responsive-pricing-table-pro/rpt_pro.php')) {
|
14 |
+
|
15 |
+
function my_admin_notice(){
|
16 |
+
echo '<div class="updated">
|
17 |
+
<p><strong>PRO</strong> version is activated.</p>
|
18 |
+
</div>';
|
19 |
+
}
|
20 |
+
add_action('admin_notices', 'my_admin_notice');
|
21 |
+
|
22 |
+
deactivate_plugins(__FILE__);
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
add_action( 'admin_init', 'free_pro_check' );
|
27 |
+
|
28 |
+
//adds stylesheet
|
29 |
+
add_action( 'wp_enqueue_scripts', 'add_rpt_style' );
|
30 |
+
function add_rpt_style() {
|
31 |
+
wp_enqueue_style( 'rpt', plugins_url('css/rpt_custom_style.min.css', __FILE__));
|
32 |
+
}
|
33 |
+
|
34 |
+
add_action( 'init', 'create_rpt_pricing_table_type' );
|
35 |
+
|
36 |
+
function create_rpt_pricing_table_type() {
|
37 |
+
register_post_type( 'rpt_pricing_table',
|
38 |
+
array(
|
39 |
+
'labels' => array(
|
40 |
+
'name' => 'Pricing Tables',
|
41 |
+
'singular_name' => 'Pricing Table'
|
42 |
+
),
|
43 |
+
'public' => true,
|
44 |
+
'has_archive' => false,
|
45 |
+
'hierarchical' => false,
|
46 |
+
'supports' => array( 'title' ),
|
47 |
+
'menu_icon' => 'dashicons-plus',
|
48 |
+
)
|
49 |
+
);
|
50 |
+
}
|
51 |
+
|
52 |
+
/*
|
53 |
+
* Include and setup custom metaboxes and fields.
|
54 |
+
* @category Responsive Pricing Table
|
55 |
+
* @package Metaboxes
|
56 |
+
*/
|
57 |
+
|
58 |
+
add_filter( 'dkrpt_meta_boxes', 'rpt_metaboxes' );
|
59 |
+
|
60 |
+
/*
|
61 |
+
* Define the metabox and field configurations.
|
62 |
+
* @param array $meta_boxes
|
63 |
+
* @return array
|
64 |
+
*/
|
65 |
+
function rpt_metaboxes( array $meta_boxes ) {
|
66 |
+
|
67 |
+
//hiding fields from custom fields list
|
68 |
+
$prefix = '_rpt_';
|
69 |
+
|
70 |
+
//price table single metabox (built with dkrpt)
|
71 |
+
$meta_boxes['rpt_tables_group'] = array(
|
72 |
+
'id' => 'tables_group',
|
73 |
+
'title' => 'Create / Remove your plans',
|
74 |
+
'pages' => array( 'rpt_pricing_table', ),
|
75 |
+
'dkrpt_styles' => true,
|
76 |
+
'fields' => array(
|
77 |
+
array(
|
78 |
+
'id' => $prefix . 'plan_group',
|
79 |
+
'type' => 'group',
|
80 |
+
'options' => array(
|
81 |
+
'group_title' => 'Plan {#}',
|
82 |
+
'add_button' => 'Add Plan',
|
83 |
+
'remove_button' => 'Remove Plan',
|
84 |
+
'sortable' => true,
|
85 |
+
),
|
86 |
+
'fields' => array(
|
87 |
+
array(
|
88 |
+
'name' => 'Plan header',
|
89 |
+
'id' => $prefix . 'header_desc',
|
90 |
+
'type' => 'title',
|
91 |
+
),
|
92 |
+
array(
|
93 |
+
'name' => 'Title',
|
94 |
+
'id' => $prefix . 'title',
|
95 |
+
'type' => 'text',
|
96 |
+
),
|
97 |
+
array(
|
98 |
+
'name' => 'Recommended?',
|
99 |
+
'desc' => 'check this if it\'s a recommended plan',
|
100 |
+
'id' => $prefix . 'recommended',
|
101 |
+
'type' => 'checkbox',
|
102 |
+
'default' => false,
|
103 |
+
),
|
104 |
+
array(
|
105 |
+
'name' => 'Subtitle',
|
106 |
+
'id' => $prefix . 'subtitle',
|
107 |
+
'type' => 'text',
|
108 |
+
),
|
109 |
+
array(
|
110 |
+
'name' => 'Description',
|
111 |
+
'id' => $prefix . 'description',
|
112 |
+
'type' => 'text',
|
113 |
+
),
|
114 |
+
array(
|
115 |
+
'name' => 'Price',
|
116 |
+
'id' => $prefix . 'price',
|
117 |
+
'type' => 'text',
|
118 |
+
),
|
119 |
+
array(
|
120 |
+
'name' => 'Free?',
|
121 |
+
'desc' => 'check this if this plan is free',
|
122 |
+
'id' => $prefix . 'free',
|
123 |
+
'type' => 'checkbox',
|
124 |
+
'default' => false,
|
125 |
+
),
|
126 |
+
array(
|
127 |
+
'name' => 'Recurrence',
|
128 |
+
'id' => $prefix . 'recurrence',
|
129 |
+
'type' => 'text',
|
130 |
+
'attributes' => array(
|
131 |
+
'placeholder' => 'eg. per month, one time fee',
|
132 |
+
),
|
133 |
+
),
|
134 |
+
array(
|
135 |
+
'name' => 'Small icon',
|
136 |
+
'id' => $prefix . 'icon',
|
137 |
+
'type' => 'file',
|
138 |
+
'attributes' => array(
|
139 |
+
'placeholder' => 'recommended size: 30 x 30',
|
140 |
+
),
|
141 |
+
),
|
142 |
+
array(
|
143 |
+
'name' => 'Plan features',
|
144 |
+
'desc' => '<div style="margin-top: 20px;line-height:24px; padding:10px; padding-left:30px; border-left:grey solid 4px;"><span style="font-style:normal; color:black;"><span style="color:black;"><strong><strong></strong></span> tags allowed for bold text.<br/><span style="color:#bbbbbb; font-size:12px;">eg. "<strong>5</strong> products in the store".</span><br/>Use prefix "<span style="color:black;"><strong>-n</strong></span>" if the feature isn\'t available in this plan.<br/><span style="color:#bbbbbb; font-size:12px;">eg. "-n Custom domain name."</span></span></div>',
|
145 |
+
'id' => $prefix . 'features_desc',
|
146 |
+
'type' => 'title',
|
147 |
+
),
|
148 |
+
array(
|
149 |
+
'name' => 'Features',
|
150 |
+
'id' => $prefix . 'features',
|
151 |
+
'type' => 'textarea',
|
152 |
+
'attributes' => array(
|
153 |
+
'placeholder' => 'one per line',
|
154 |
+
),
|
155 |
+
),
|
156 |
+
array(
|
157 |
+
'name' => 'Plan button',
|
158 |
+
'id' => $prefix . 'plan_button_desc',
|
159 |
+
'type' => 'title',
|
160 |
+
),
|
161 |
+
array(
|
162 |
+
'name' => 'Button text',
|
163 |
+
'id' => $prefix . 'btn_text',
|
164 |
+
'type' => 'text',
|
165 |
+
'attributes' => array(
|
166 |
+
'placeholder' => 'eg. Sign up, Buy',
|
167 |
+
),
|
168 |
+
),
|
169 |
+
array(
|
170 |
+
'name' => 'Button link',
|
171 |
+
'id' => $prefix . 'btn_link',
|
172 |
+
'type' => 'text',
|
173 |
+
'attributes' => array(
|
174 |
+
'placeholder' => 'eg. http://anything.com',
|
175 |
+
),
|
176 |
+
),
|
177 |
+
array(
|
178 |
+
'name' => 'Plan styling',
|
179 |
+
'id' => $prefix . 'styling_desc',
|
180 |
+
'type' => 'title',
|
181 |
+
),
|
182 |
+
array(
|
183 |
+
'name' => 'Color',
|
184 |
+
'id' => $prefix . 'color',
|
185 |
+
'type' => 'colorpicker',
|
186 |
+
'default' => '#9fdb80',
|
187 |
+
),
|
188 |
+
),
|
189 |
+
),
|
190 |
+
),
|
191 |
+
);
|
192 |
+
|
193 |
+
//price table single metabox (built with dkrpt)
|
194 |
+
$meta_boxes['rpt_settings_group'] = array(
|
195 |
+
'id' => $prefix . 'settings_group',
|
196 |
+
'title' => 'Pricing table settings',
|
197 |
+
'pages' => array( 'rpt_pricing_table', ),
|
198 |
+
'dkrpt_styles' => true,
|
199 |
+
'context' => 'side',
|
200 |
+
'fields' => array(
|
201 |
+
array(
|
202 |
+
'name' => 'General settings',
|
203 |
+
'id' => $prefix . 'other_settings_desc',
|
204 |
+
'type' => 'title',
|
205 |
+
),
|
206 |
+
array(
|
207 |
+
'name' => 'Change currency',
|
208 |
+
'id' => $prefix . 'currency',
|
209 |
+
'type' => 'text',
|
210 |
+
'default' => '$',
|
211 |
+
),
|
212 |
+
array(
|
213 |
+
'name' => 'Links behavior',
|
214 |
+
'id' => $prefix . 'open_newwindow',
|
215 |
+
'type' => 'select',
|
216 |
+
'options' => array(
|
217 |
+
'currentwindow' => 'Open in current window',
|
218 |
+
'newwindow' => 'Open in new window/tab',
|
219 |
+
),
|
220 |
+
'default' => 'currentwindow',
|
221 |
+
),
|
222 |
+
array(
|
223 |
+
'name' => 'Font sizes',
|
224 |
+
'id' => $prefix . 'font_sizes_desc',
|
225 |
+
'type' => 'title',
|
226 |
+
),
|
227 |
+
array(
|
228 |
+
'name' => 'Title font size',
|
229 |
+
'id' => $prefix . 'title_fontsize',
|
230 |
+
'type' => 'select',
|
231 |
+
'options' => array(
|
232 |
+
'tiny' => 'Tiny',
|
233 |
+
'small' => 'Small',
|
234 |
+
'normal' => 'Normal',
|
235 |
+
),
|
236 |
+
'default' => 'normal',
|
237 |
+
),
|
238 |
+
array(
|
239 |
+
'name' => 'Subtitle font size',
|
240 |
+
'id' => $prefix . 'subtitle_fontsize',
|
241 |
+
'type' => 'select',
|
242 |
+
'options' => array(
|
243 |
+
'tiny' => 'Tiny',
|
244 |
+
'small' => 'Small',
|
245 |
+
'normal' => 'Normal',
|
246 |
+
),
|
247 |
+
'default' => 'normal',
|
248 |
+
),
|
249 |
+
array(
|
250 |
+
'name' => 'Description font size',
|
251 |
+
'id' => $prefix . 'description_fontsize',
|
252 |
+
'type' => 'select',
|
253 |
+
'options' => array(
|
254 |
+
'small' => 'Small',
|
255 |
+
'normal' => 'Normal',
|
256 |
+
),
|
257 |
+
'default' => 'normal',
|
258 |
+
),
|
259 |
+
array(
|
260 |
+
'name' => 'Price font size',
|
261 |
+
'id' => $prefix . 'price_fontsize',
|
262 |
+
'type' => 'select',
|
263 |
+
'options' => array(
|
264 |
+
'tiny' => 'Tiny',
|
265 |
+
'small' => 'Small',
|
266 |
+
'normal' => 'Normal',
|
267 |
+
),
|
268 |
+
'default' => 'normal',
|
269 |
+
),
|
270 |
+
array(
|
271 |
+
'name' => 'Recurrence font size',
|
272 |
+
'id' => $prefix . 'recurrence_fontsize',
|
273 |
+
'type' => 'select',
|
274 |
+
'options' => array(
|
275 |
+
'small' => 'Small',
|
276 |
+
'normal' => 'Normal',
|
277 |
+
),
|
278 |
+
'default' => 'normal',
|
279 |
+
),
|
280 |
+
array(
|
281 |
+
'name' => 'Features font size',
|
282 |
+
'id' => $prefix . 'features_fontsize',
|
283 |
+
'type' => 'select',
|
284 |
+
'options' => array(
|
285 |
+
'small' => 'Small',
|
286 |
+
'normal' => 'Normal',
|
287 |
+
),
|
288 |
+
'default' => 'normal',
|
289 |
+
),
|
290 |
+
array(
|
291 |
+
'name' => 'Button font size',
|
292 |
+
'id' => $prefix . 'button_fontsize',
|
293 |
+
'type' => 'select',
|
294 |
+
'options' => array(
|
295 |
+
'small' => 'Small',
|
296 |
+
'normal' => 'Normal',
|
297 |
+
),
|
298 |
+
'default' => 'normal',
|
299 |
+
),
|
300 |
+
),
|
301 |
+
);
|
302 |
+
|
303 |
+
return $meta_boxes;
|
304 |
+
}
|
305 |
+
|
306 |
+
add_action( 'init', 'rpt_initialize_dkrpt_meta_boxes', 9999 );
|
307 |
+
|
308 |
+
//metabox class
|
309 |
+
function rpt_initialize_dkrpt_meta_boxes() {
|
310 |
+
|
311 |
+
if ( ! class_exists( 'dkrpt_Meta_Box' ) )
|
312 |
+
require_once 'dkrpt/init.php';
|
313 |
+
}
|
314 |
+
|
315 |
+
//shortcode columns
|
316 |
+
add_action( 'manage_rpt_pricing_table_posts_custom_column' , 'rpt_custom_columns', 10, 2 );
|
317 |
+
|
318 |
+
function rpt_custom_columns( $column, $post_id ) {
|
319 |
+
switch ( $column ) {
|
320 |
+
case 'shortcode' :
|
321 |
+
global $post;
|
322 |
+
$slug = '' ;
|
323 |
+
$slug = $post->post_name;
|
324 |
+
|
325 |
+
|
326 |
+
$shortcode = '<span style="border: solid 3px lightgray; background:white; padding:7px; font-size:17px; line-height:40px;">[rpt name="'.$slug.'"]</strong>';
|
327 |
+
echo $shortcode;
|
328 |
+
break;
|
329 |
+
}
|
330 |
+
}
|
331 |
+
|
332 |
+
function add_rpt_pricing_table_columns($columns) {
|
333 |
+
return array_merge($columns,
|
334 |
+
array('shortcode' => __('Shortcode'),
|
335 |
+
));
|
336 |
+
}
|
337 |
+
add_filter('manage_rpt_pricing_table_posts_columns' , 'add_rpt_pricing_table_columns');
|
338 |
+
|
339 |
+
//rpt shortcode
|
340 |
+
function rpt_sc($atts) {
|
341 |
+
extract(shortcode_atts(array(
|
342 |
+
"name" => ''
|
343 |
+
), $atts));
|
344 |
+
|
345 |
+
$output = '';
|
346 |
+
|
347 |
+
query_posts( array( 'post_type' => 'rpt_pricing_table', 'name' => $name, ) );
|
348 |
+
if ( have_posts() ) : while ( have_posts() ) : the_post();
|
349 |
+
|
350 |
+
global $post;
|
351 |
+
$entries = get_post_meta( $post->ID, '_rpt_plan_group', true );
|
352 |
+
|
353 |
+
$nb_entries = count($entries);;
|
354 |
+
|
355 |
+
//get font sizes
|
356 |
+
$title_fontsize = get_post_meta( $post->ID, '_rpt_title_fontsize', true );
|
357 |
+
if ($title_fontsize == 'small') {
|
358 |
+
$title_fs_class = ' rpt_sm_title';
|
359 |
+
} else if ($title_fontsize == 'tiny') {
|
360 |
+
$title_fs_class = ' rpt_xsm_title';
|
361 |
+
} else {
|
362 |
+
$title_fs_class = '';
|
363 |
+
}
|
364 |
+
|
365 |
+
$subtitle_fontsize = get_post_meta( $post->ID, '_rpt_subtitle_fontsize', true );
|
366 |
+
if ($subtitle_fontsize == 'small') {
|
367 |
+
$subtitle_fs_class = ' rpt_sm_subtitle';
|
368 |
+
} else if ($subtitle_fontsize == 'tiny') {
|
369 |
+
$subtitle_fs_class = ' rpt_xsm_subtitle';
|
370 |
+
} else {
|
371 |
+
$subtitle_fs_class = '';
|
372 |
+
}
|
373 |
+
|
374 |
+
$description_fontsize = get_post_meta( $post->ID, '_rpt_description_fontsize', true );
|
375 |
+
if ($description_fontsize == 'small') {
|
376 |
+
$description_fs_class = ' rpt_sm_description';
|
377 |
+
} else {
|
378 |
+
$description_fs_class = '';
|
379 |
+
}
|
380 |
+
|
381 |
+
$price_fontsize = get_post_meta( $post->ID, '_rpt_price_fontsize', true );
|
382 |
+
if ($price_fontsize == 'small') {
|
383 |
+
$price_fs_class = ' rpt_sm_price';
|
384 |
+
} else if ($price_fontsize == 'tiny') {
|
385 |
+
$price_fs_class = ' rpt_xsm_price';
|
386 |
+
} else {
|
387 |
+
$price_fs_class = '';
|
388 |
+
}
|
389 |
+
|
390 |
+
$recurrence_fontsize = get_post_meta( $post->ID, '_rpt_recurrence_fontsize', true );
|
391 |
+
if ($recurrence_fontsize == 'small') {
|
392 |
+
$recurrence_fs_class = ' rpt_sm_recurrence';
|
393 |
+
} else {
|
394 |
+
$recurrence_fs_class = '';
|
395 |
+
}
|
396 |
+
|
397 |
+
$features_fontsize = get_post_meta( $post->ID, '_rpt_features_fontsize', true );
|
398 |
+
if ($features_fontsize == 'small') {
|
399 |
+
$features_fs_class = ' rpt_sm_features';
|
400 |
+
} else {
|
401 |
+
$features_fs_class = '';
|
402 |
+
}
|
403 |
+
|
404 |
+
$button_fontsize = get_post_meta( $post->ID, '_rpt_button_fontsize', true );
|
405 |
+
if ($button_fontsize == 'small') {
|
406 |
+
$button_fs_class = ' rpt_sm_button';
|
407 |
+
} else {
|
408 |
+
$button_fs_class = '';
|
409 |
+
}
|
410 |
+
|
411 |
+
//opening rpt_pricr container
|
412 |
+
$output .= '<div id="rpt_pricr" class="rpt_plans rpt_'.$nb_entries .'_plans rpt_style_basic">';
|
413 |
+
|
414 |
+
//opening rpt_pricr inner
|
415 |
+
$output .= '<div class="'. $title_fs_class . $subtitle_fs_class . $description_fs_class . $price_fs_class . $recurrence_fs_class . $features_fs_class. $button_fs_class .'">';
|
416 |
+
|
417 |
+
foreach ($entries as $key => $plans) {
|
418 |
+
|
419 |
+
if (!empty($plans['_rpt_recommended'])){
|
420 |
+
$is_reco = $plans['_rpt_recommended'];
|
421 |
+
//opening plan
|
422 |
+
if ($is_reco == true ){
|
423 |
+
$reco = '<img class="rpt_recommended" src="' . plugins_url('img/rpt_recommended.png', __FILE__) . '"/>';
|
424 |
+
$reco_class = 'rpt_recommended_plan';
|
425 |
+
} else if ($is_reco == false ) {
|
426 |
+
$reco = '';
|
427 |
+
$reco_class = '';
|
428 |
+
}
|
429 |
+
} else {
|
430 |
+
$reco = '';
|
431 |
+
$reco_class = '';
|
432 |
+
}
|
433 |
+
|
434 |
+
$output .= '<div class="rpt_plan rpt_plan_' . $key . ' ' . $reco_class . '">';
|
435 |
+
|
436 |
+
//title
|
437 |
+
if (!empty($plans['_rpt_title'])){
|
438 |
+
$output .= '<div class="rpt_title rpt_title_' . $key . '">';
|
439 |
+
|
440 |
+
if (!empty($plans['_rpt_icon'])){
|
441 |
+
$output .= '<img height=30px width=30px src="' . $plans['_rpt_icon'] . '" class="rpt_icon rpt_icon_' . $key . '"/> ';
|
442 |
+
}
|
443 |
+
|
444 |
+
$output .= $plans['_rpt_title'];
|
445 |
+
$output .= $reco . '</div>';
|
446 |
+
}
|
447 |
+
|
448 |
+
//head
|
449 |
+
$output .= '<div class="rpt_head rpt_head_' . $key . '">';
|
450 |
+
|
451 |
+
//recurrence
|
452 |
+
if (!empty($plans['_rpt_recurrence'])){
|
453 |
+
$output .= '<div class="rpt_recurrence rpt_recurrence_' . $key . '">' . $plans['_rpt_recurrence'] . '</div>';
|
454 |
+
}
|
455 |
+
|
456 |
+
//price
|
457 |
+
if (!empty($plans['_rpt_price'])){
|
458 |
+
|
459 |
+
$output .= '<div class="rpt_price rpt_price_' . $key . '">';
|
460 |
+
|
461 |
+
if (!empty($plans['_rpt_free'])){
|
462 |
+
if ($plans['_rpt_free'] == true ){
|
463 |
+
$output .= __( 'Free' );
|
464 |
+
} else {
|
465 |
+
$output .= '<span class="rpt_currency">$</span>' . $plans['_rpt_price'];
|
466 |
+
}
|
467 |
+
} else {
|
468 |
+
|
469 |
+
$currency = get_post_meta( $post->ID, '_rpt_currency', true );
|
470 |
+
|
471 |
+
if (!empty($currency)){
|
472 |
+
$output .= '<span class="rpt_currency">';
|
473 |
+
$output .= $currency;
|
474 |
+
$output .= '</span>';
|
475 |
+
}
|
476 |
+
|
477 |
+
$output .= $plans['_rpt_price'];
|
478 |
+
|
479 |
+
}
|
480 |
+
|
481 |
+
$output .= '</div>';
|
482 |
+
}
|
483 |
+
|
484 |
+
//subtitle
|
485 |
+
if (!empty($plans['_rpt_subtitle'])){
|
486 |
+
$output .= '<div style="color:' . $plans['_rpt_color'] . ';" class="rpt_subtitle rpt_subtitle_' . $key . '">' . $plans['_rpt_subtitle'] . '</div>';
|
487 |
+
}
|
488 |
+
|
489 |
+
//description
|
490 |
+
if (!empty($plans['_rpt_description'])){
|
491 |
+
$output .= '<div class="rpt_description rpt_description_' . $key . '">' . $plans['_rpt_description'] . '</div>';
|
492 |
+
}
|
493 |
+
|
494 |
+
//closing plan head
|
495 |
+
$output .= '</div>';
|
496 |
+
|
497 |
+
|
498 |
+
if (!empty($plans['_rpt_features'])){
|
499 |
+
|
500 |
+
$output .= '<div class="rpt_features rpt_features_' . $key . '">';
|
501 |
+
|
502 |
+
$string = $plans['_rpt_features'];
|
503 |
+
$stringAr = explode("\n", $string);
|
504 |
+
$stringAr = array_filter($stringAr, 'trim'); // remove any extra \r characters left behind
|
505 |
+
|
506 |
+
$features = '';
|
507 |
+
|
508 |
+
foreach ($stringAr as $feature) {
|
509 |
+
$features[] .= strip_tags($feature,'<strong></strong>');
|
510 |
+
}
|
511 |
+
|
512 |
+
foreach ($features as $small_key => $feature){
|
513 |
+
if (!empty($feature)){
|
514 |
+
|
515 |
+
$check = substr($feature, 0, 2);
|
516 |
+
if ($check == '-n') {
|
517 |
+
$feature = substr($feature, 2);
|
518 |
+
$check_color = '#bbbbbb';
|
519 |
+
} else {
|
520 |
+
$check_color = 'black';
|
521 |
+
}
|
522 |
+
|
523 |
+
$output .= '<div style="color:' . $check_color . ';" class="rpt_feature rpt_feature_' . $key . '-' . $small_key . '">';
|
524 |
+
$output .= $feature;
|
525 |
+
$output .= '</div>';
|
526 |
+
|
527 |
+
}
|
528 |
+
}
|
529 |
+
|
530 |
+
$output .= '</div>';
|
531 |
+
}
|
532 |
+
|
533 |
+
if (!empty($plans['_rpt_btn_text'])){
|
534 |
+
$btn_text = $plans['_rpt_btn_text'];
|
535 |
+
if (!empty($plans['_rpt_btn_link'])){
|
536 |
+
$btn_link = $plans['_rpt_btn_link'];
|
537 |
+
} else { $btn_link = 'http://#'; }
|
538 |
+
} else {
|
539 |
+
$btn_text = 'Sign up';
|
540 |
+
$btn_link = 'http://#';
|
541 |
+
}
|
542 |
+
|
543 |
+
//link option
|
544 |
+
$newcurrentwindow = get_post_meta( $post->ID, '_rpt_open_newwindow', true );
|
545 |
+
if ($newcurrentwindow == 'newwindow'){
|
546 |
+
$link_behavior = 'target="_blank"';
|
547 |
+
} else {
|
548 |
+
$link_behavior = 'target="_self"';
|
549 |
+
}
|
550 |
+
|
551 |
+
//foot
|
552 |
+
$output .= '<a '. $link_behavior .' href="' . $btn_link . '" style="background:' . $plans['_rpt_color'] . '" class="rpt_foot rpt_foot_' . $key . '">';
|
553 |
+
|
554 |
+
//closing foot
|
555 |
+
$output .= $btn_text;
|
556 |
+
|
557 |
+
//closing foot
|
558 |
+
$output .= '</a>';
|
559 |
+
|
560 |
+
$output .= '</div>';
|
561 |
+
|
562 |
+
}
|
563 |
+
|
564 |
+
//closing rpt_inner
|
565 |
+
$output .= '</div>';
|
566 |
+
|
567 |
+
//closing rpt_container
|
568 |
+
$output .= '</div>';
|
569 |
+
|
570 |
+
$output .= '<div style="clear:both;"></div>';
|
571 |
+
|
572 |
+
|
573 |
+
endwhile; endif; wp_reset_query();
|
574 |
+
|
575 |
+
return $output;
|
576 |
+
|
577 |
+
}
|
578 |
+
add_shortcode("rpt", "rpt_sc");
|
579 |
+
|
580 |
?>
|