Responsive Pricing Table - Version 3.5

Version Description

  • SAFE UPDATE: No data loss for those upgrading from version 3.0 or higher
  • You can now put this shortcode inside another one if you want (nested shortcodes)
Download this release

Release Info

Developer spwebguy
Plugin Icon 128x128 Responsive Pricing Table
Version 3.5
Comparing to
See all releases

Code changes from version 3.4.2 to 3.5

Files changed (2) hide show
  1. readme.txt +4 -0
  2. rpt.php +43 -41
readme.txt CHANGED
@@ -72,6 +72,10 @@ The free version of the Responsive Pricing Table plugin is **not limited** and d
72
 
73
 
74
  == Changelog ==
 
 
 
 
75
  = 3.4.2 =
76
  * SAFE UPDATE: No data loss for those upgrading from version 3.0 or higher
77
  * Admin panel small bug fix
72
 
73
 
74
  == Changelog ==
75
+ = 3.5 =
76
+ * SAFE UPDATE: No data loss for those upgrading from version 3.0 or higher
77
+ * You can now put this shortcode inside another one if you want (nested shortcodes)
78
+
79
  = 3.4.2 =
80
  * SAFE UPDATE: No data loss for those upgrading from version 3.0 or higher
81
  * Admin panel small bug fix
rpt.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Responsive Pricing Table
4
  * Plugin URI: http://wpdarko.com/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/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/responsive-pricing-table-pro/'>PRO version</a> for more great features.
6
- * Version: 3.4.2
7
  * Author: WP Darko
8
  * Author URI: http://wpdarko.com
9
  * License: GPL2
@@ -370,12 +370,14 @@ function rpt_sc($atts) {
370
  "name" => ''
371
  ), $atts));
372
 
373
- $output = '';
374
-
375
- query_posts( array( 'post_type' => 'rpt_pricing_table', 'name' => $name, ) );
376
- if ( have_posts() ) : while ( have_posts() ) : the_post();
 
 
 
377
 
378
- global $post;
379
  $entries = get_post_meta( $post->ID, '_rpt_plan_group', true );
380
 
381
  $nb_entries = count($entries);;
@@ -439,10 +441,10 @@ function rpt_sc($atts) {
439
  }
440
 
441
  //opening rpt_pricr container
442
- $output .= '<div id="rpt_pricr" class="rpt_plans rpt_'.$nb_entries .'_plans rpt_style_basic">';
443
 
444
  //opening rpt_pricr inner
445
- $output .= '<div class="'. $title_fs_class . $subtitle_fs_class . $description_fs_class . $price_fs_class . $recurrence_fs_class . $features_fs_class. $button_fs_class .'">';
446
 
447
  foreach ($entries as $key => $plans) {
448
 
@@ -461,74 +463,74 @@ function rpt_sc($atts) {
461
  $reco_class = '';
462
  }
463
 
464
- $output .= '<div class="rpt_plan rpt_plan_' . $key . ' ' . $reco_class . '">';
465
 
466
  //title
467
  if (!empty($plans['_rpt_title'])){
468
- $output .= '<div class="rpt_title rpt_title_' . $key . '">';
469
 
470
  if (!empty($plans['_rpt_icon'])){
471
- $output .= '<img height=30px width=30px src="' . $plans['_rpt_icon'] . '" class="rpt_icon rpt_icon_' . $key . '"/> ';
472
  }
473
 
474
- $output .= $plans['_rpt_title'];
475
- $output .= $reco . '</div>';
476
  }
477
 
478
  //head
479
- $output .= '<div class="rpt_head rpt_head_' . $key . '">';
480
 
481
  //recurrence
482
  if (!empty($plans['_rpt_recurrence'])){
483
- $output .= '<div class="rpt_recurrence rpt_recurrence_' . $key . '">' . $plans['_rpt_recurrence'] . '</div>';
484
  }
485
 
486
  //price
487
  if (!empty($plans['_rpt_price'])){
488
 
489
- $output .= '<div class="rpt_price rpt_price_' . $key . '">';
490
 
491
  if (!empty($plans['_rpt_free'])){
492
  if ($plans['_rpt_free'] == true ){
493
- $output .= __( 'Free' );
494
  } else {
495
- $output .= '<span class="rpt_currency"></span>' . $plans['_rpt_price'];
496
  }
497
  } else {
498
 
499
  $currency = get_post_meta( $post->ID, '_rpt_currency', true );
500
 
501
  if (!empty($currency)){
502
- $output .= '<span class="rpt_currency">';
503
- $output .= $currency;
504
- $output .= '</span>';
505
  }
506
 
507
- $output .= $plans['_rpt_price'];
508
 
509
  }
510
 
511
- $output .= '</div>';
512
  }
513
 
514
  //subtitle
515
  if (!empty($plans['_rpt_subtitle'])){
516
- $output .= '<div style="color:' . $plans['_rpt_color'] . ';" class="rpt_subtitle rpt_subtitle_' . $key . '">' . $plans['_rpt_subtitle'] . '</div>';
517
  }
518
 
519
  //description
520
  if (!empty($plans['_rpt_description'])){
521
- $output .= '<div class="rpt_description rpt_description_' . $key . '">' . $plans['_rpt_description'] . '</div>';
522
  }
523
 
524
  //closing plan head
525
- $output .= '</div>';
526
 
527
 
528
  if (!empty($plans['_rpt_features'])){
529
 
530
 
531
- $output .= '<div class="rpt_features rpt_features_' . $key . '">';
532
 
533
 
534
  $string = $plans['_rpt_features'];
@@ -552,14 +554,14 @@ function rpt_sc($atts) {
552
  $check_color = 'black';
553
  }
554
 
555
- $output .= '<div style="color:' . $check_color . ';" class="rpt_feature rpt_feature_' . $key . '-' . $small_key . '">';
556
- $output .= $feature;
557
- $output .= '</div>';
558
 
559
  }
560
  }
561
 
562
- $output .= '</div>';
563
  }
564
 
565
  if (!empty($plans['_rpt_btn_text'])){
@@ -582,33 +584,33 @@ function rpt_sc($atts) {
582
 
583
  //foot
584
  if (!empty($plans['_rpt_btn_text'])){
585
- $output .= '<a '. $link_behavior .' href="' . $btn_link . '" style="background:' . $plans['_rpt_color'] . '" class="rpt_foot rpt_foot_' . $key . '">';
586
  } else {
587
- $output .= '<a '. $link_behavior .' style="background:' . $plans['_rpt_color'] . '" class="rpt_foot rpt_foot_' . $key . '">';
588
  }
589
 
590
  //closing foot
591
- $output .= $btn_text;
592
 
593
  //closing foot
594
- $output .= '</a>';
595
 
596
- $output .= '</div>';
597
 
598
  }
599
 
600
  //closing rpt_inner
601
- $output .= '</div>';
602
 
603
  //closing rpt_container
604
- $output .= '</div>';
605
 
606
- $output .= '<div style="clear:both;"></div>';
607
 
608
 
609
- endwhile; endif; wp_reset_query();
610
 
611
- return $output;
612
 
613
  }
614
  add_shortcode("rpt", "rpt_sc");
3
  * Plugin Name: Responsive Pricing Table
4
  * Plugin URI: http://wpdarko.com/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/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/responsive-pricing-table-pro/'>PRO version</a> for more great features.
6
+ * Version: 3.5
7
  * Author: WP Darko
8
  * Author URI: http://wpdarko.com
9
  * License: GPL2
370
  "name" => ''
371
  ), $atts));
372
 
373
+ $output2 = '';
374
+
375
+ global $post;
376
+
377
+ $args = array('post_type' => 'rpt_pricing_table', 'name' => $name);
378
+ $custom_posts = get_posts($args);
379
+ foreach($custom_posts as $post) : setup_postdata($post);
380
 
 
381
  $entries = get_post_meta( $post->ID, '_rpt_plan_group', true );
382
 
383
  $nb_entries = count($entries);;
441
  }
442
 
443
  //opening rpt_pricr container
444
+ $output2 .= '<div id="rpt_pricr" class="rpt_plans rpt_'.$nb_entries .'_plans rpt_style_basic">';
445
 
446
  //opening rpt_pricr inner
447
+ $output2 .= '<div class="'. $title_fs_class . $subtitle_fs_class . $description_fs_class . $price_fs_class . $recurrence_fs_class . $features_fs_class. $button_fs_class .'">';
448
 
449
  foreach ($entries as $key => $plans) {
450
 
463
  $reco_class = '';
464
  }
465
 
466
+ $output2 .= '<div class="rpt_plan rpt_plan_' . $key . ' ' . $reco_class . '">';
467
 
468
  //title
469
  if (!empty($plans['_rpt_title'])){
470
+ $output2 .= '<div class="rpt_title rpt_title_' . $key . '">';
471
 
472
  if (!empty($plans['_rpt_icon'])){
473
+ $output2 .= '<img height=30px width=30px src="' . $plans['_rpt_icon'] . '" class="rpt_icon rpt_icon_' . $key . '"/> ';
474
  }
475
 
476
+ $output2 .= $plans['_rpt_title'];
477
+ $output2 .= $reco . '</div>';
478
  }
479
 
480
  //head
481
+ $output2 .= '<div class="rpt_head rpt_head_' . $key . '">';
482
 
483
  //recurrence
484
  if (!empty($plans['_rpt_recurrence'])){
485
+ $output2 .= '<div class="rpt_recurrence rpt_recurrence_' . $key . '">' . $plans['_rpt_recurrence'] . '</div>';
486
  }
487
 
488
  //price
489
  if (!empty($plans['_rpt_price'])){
490
 
491
+ $output2 .= '<div class="rpt_price rpt_price_' . $key . '">';
492
 
493
  if (!empty($plans['_rpt_free'])){
494
  if ($plans['_rpt_free'] == true ){
495
+ $output2 .= __( 'Free' );
496
  } else {
497
+ $output2 .= '<span class="rpt_currency"></span>' . $plans['_rpt_price'];
498
  }
499
  } else {
500
 
501
  $currency = get_post_meta( $post->ID, '_rpt_currency', true );
502
 
503
  if (!empty($currency)){
504
+ $output2 .= '<span class="rpt_currency">';
505
+ $output2 .= $currency;
506
+ $output2 .= '</span>';
507
  }
508
 
509
+ $output2 .= $plans['_rpt_price'];
510
 
511
  }
512
 
513
+ $output2 .= '</div>';
514
  }
515
 
516
  //subtitle
517
  if (!empty($plans['_rpt_subtitle'])){
518
+ $output2 .= '<div style="color:' . $plans['_rpt_color'] . ';" class="rpt_subtitle rpt_subtitle_' . $key . '">' . $plans['_rpt_subtitle'] . '</div>';
519
  }
520
 
521
  //description
522
  if (!empty($plans['_rpt_description'])){
523
+ $output2 .= '<div class="rpt_description rpt_description_' . $key . '">' . $plans['_rpt_description'] . '</div>';
524
  }
525
 
526
  //closing plan head
527
+ $output2 .= '</div>';
528
 
529
 
530
  if (!empty($plans['_rpt_features'])){
531
 
532
 
533
+ $output2 .= '<div class="rpt_features rpt_features_' . $key . '">';
534
 
535
 
536
  $string = $plans['_rpt_features'];
554
  $check_color = 'black';
555
  }
556
 
557
+ $output2 .= '<div style="color:' . $check_color . ';" class="rpt_feature rpt_feature_' . $key . '-' . $small_key . '">';
558
+ $output2 .= $feature;
559
+ $output2 .= '</div>';
560
 
561
  }
562
  }
563
 
564
+ $output2 .= '</div>';
565
  }
566
 
567
  if (!empty($plans['_rpt_btn_text'])){
584
 
585
  //foot
586
  if (!empty($plans['_rpt_btn_text'])){
587
+ $output2 .= '<a '. $link_behavior .' href="' . $btn_link . '" style="background:' . $plans['_rpt_color'] . '" class="rpt_foot rpt_foot_' . $key . '">';
588
  } else {
589
+ $output2 .= '<a '. $link_behavior .' style="background:' . $plans['_rpt_color'] . '" class="rpt_foot rpt_foot_' . $key . '">';
590
  }
591
 
592
  //closing foot
593
+ $output2 .= $btn_text;
594
 
595
  //closing foot
596
+ $output2 .= '</a>';
597
 
598
+ $output2 .= '</div>';
599
 
600
  }
601
 
602
  //closing rpt_inner
603
+ $output2 .= '</div>';
604
 
605
  //closing rpt_container
606
+ $output2 .= '</div>';
607
 
608
+ $output2 .= '<div style="clear:both;"></div>';
609
 
610
 
611
+ endforeach; wp_reset_query();
612
 
613
+ return $output2;
614
 
615
  }
616
  add_shortcode("rpt", "rpt_sc");