Shortcodes by Angie Makes - Version 3.3

Version Description

Download this release

Release Info

Developer cbaldelomar
Plugin Icon wp plugin Shortcodes by Angie Makes
Version 3.3
Comparing to
See all releases

Code changes from version 3.2 to 3.3

Files changed (36) hide show
  1. README.md +4 -0
  2. admin/assets/css/wc-shortcodes.css +1 -1
  3. admin/assets/css/{wcpostsliderwidget.css → wcpostswidget.css} +6 -6
  4. admin/assets/js/shortcodes-tinymce-4.js +4 -4
  5. admin/assets/js/wc-shortcodes.js +3 -3
  6. admin/assets/js/{wcpostsliderwidget.js → wcpostswidget.js} +1 -1
  7. admin/class-admin.php +2 -2
  8. admin/class-ajax.php +4 -0
  9. public/class-register.php +80 -272
  10. public/class-sanitize.php +189 -33
  11. public/class-vars.php +84 -1
  12. public/class-widgets.php +1 -0
  13. public/templates/borderless/content-aside.php +2 -2
  14. public/templates/borderless/content-audio.php +2 -2
  15. public/templates/borderless/content-chat.php +3 -3
  16. public/templates/borderless/content-excerpt.php +3 -3
  17. public/templates/borderless/content-gallery.php +2 -2
  18. public/templates/borderless/content-link.php +3 -3
  19. public/templates/borderless/content-quote.php +1 -1
  20. public/templates/borderless/content-video.php +2 -2
  21. public/templates/borderless/content.php +3 -3
  22. public/templates/borderless/entry-meta.php +4 -4
  23. public/templates/box/content-aside.php +2 -2
  24. public/templates/box/content-audio.php +2 -2
  25. public/templates/box/content-chat.php +3 -3
  26. public/templates/box/content-excerpt.php +3 -3
  27. public/templates/box/content-gallery.php +2 -2
  28. public/templates/box/content-link.php +3 -3
  29. public/templates/box/content-quote.php +1 -1
  30. public/templates/box/content-video.php +2 -2
  31. public/templates/box/content.php +3 -3
  32. public/templates/box/entry-meta.php +4 -4
  33. public/widgets/widget-post-slider.php +44 -89
  34. public/widgets/widget-posts.php +291 -0
  35. readme.txt +4 -0
  36. wc-shortcodes.php +1 -3
README.md CHANGED
@@ -66,6 +66,10 @@ Use the shortcode manager in the TinyMCE text editor
66
 
67
  ## Changelog ##
68
 
 
 
 
 
69
  ### Version 3.2
70
 
71
  * updated old image path to new image path
66
 
67
  ## Changelog ##
68
 
69
+ ### Version 3.3
70
+
71
+ * updated posts shortcode to include visual manager for attributes
72
+
73
  ### Version 3.2
74
 
75
  * updated old image path to new image path
admin/assets/css/wc-shortcodes.css CHANGED
@@ -26,7 +26,7 @@
26
  #wc-shortcode-modal.hide-insert-button .media-button-insert {
27
  display: none;
28
  }
29
- .wc-shortcodes-post-slider-widget .wcs-description {
30
  font-style: italic;
31
  margin: 2px 0 5px;
32
  color: #aaa;
26
  #wc-shortcode-modal.hide-insert-button .media-button-insert {
27
  display: none;
28
  }
29
+ .wc-shortcodes-visual-manager .wcs-description {
30
  font-style: italic;
31
  margin: 2px 0 5px;
32
  color: #aaa;
admin/assets/css/{wcpostsliderwidget.css → wcpostswidget.css} RENAMED
@@ -1,15 +1,15 @@
1
- html .wc-shortcodes-post-slider-widget.ui-accordion {
2
  margin-bottom: 1.5em;
3
  }
4
- html .wc-shortcodes-post-slider-widget.ui-accordion .ui-autocomplete {
5
  z-index: 999999;
6
  max-height: 300px;
7
  overflow: auto;
8
  }
9
- html .wc-shortcodes-post-slider-widget.ui-accordion .ui-autocomplete li {
10
  white-space: normal;
11
  }
12
- html .wc-shortcodes-post-slider-widget.ui-accordion .ui-accordion-header {
13
  border: 1px solid #ddd;
14
  position: relative;
15
  padding: 10px 15px;
@@ -25,7 +25,7 @@ html .wc-shortcodes-post-slider-widget.ui-accordion .ui-accordion-header {
25
  font-weight: 600;
26
  margin-top: 1em;
27
  }
28
- html .wc-shortcodes-post-slider-widget.ui-accordion .ui-accordion-header:before {
29
  content: "\f345";
30
  border: none;
31
  background: 0 0;
@@ -45,6 +45,6 @@ html .wc-shortcodes-post-slider-widget.ui-accordion .ui-accordion-header:before
45
  vertical-align: bottom;
46
  margin-right: 5px;
47
  }
48
- html .wc-shortcodes-post-slider-widget.ui-accordion .ui-accordion-header.ui-accordion-header-active:before {
49
  content: "\f347";
50
  }
1
+ html .wc-shortcodes-visual-manager.ui-accordion {
2
  margin-bottom: 1.5em;
3
  }
4
+ html .wc-shortcodes-visual-manager.ui-accordion .ui-autocomplete {
5
  z-index: 999999;
6
  max-height: 300px;
7
  overflow: auto;
8
  }
9
+ html .wc-shortcodes-visual-manager.ui-accordion .ui-autocomplete li {
10
  white-space: normal;
11
  }
12
+ html .wc-shortcodes-visual-manager.ui-accordion .ui-accordion-header {
13
  border: 1px solid #ddd;
14
  position: relative;
15
  padding: 10px 15px;
25
  font-weight: 600;
26
  margin-top: 1em;
27
  }
28
+ html .wc-shortcodes-visual-manager.ui-accordion .ui-accordion-header:before {
29
  content: "\f345";
30
  border: none;
31
  background: 0 0;
45
  vertical-align: bottom;
46
  margin-right: 5px;
47
  }
48
+ html .wc-shortcodes-visual-manager.ui-accordion .ui-accordion-header.ui-accordion-header-active:before {
49
  content: "\f347";
50
  }
admin/assets/js/shortcodes-tinymce-4.js CHANGED
@@ -177,25 +177,25 @@
177
  {
178
  text: "Masonry - Box",
179
  onclick: function(){
180
- editor.insertContent('[wc_posts author="" author_name="" p="" post__in="" order="DESC" orderby="date" post_status="publish" post_type="post" posts_per_page="10" taxonomy="" field="slug" terms="" title="yes" meta_all="yes" meta_author="yes" meta_date="yes" date_format="M j, Y" meta_comments="yes" thumbnail="yes" content="yes" paging="yes" size="large" filtering="yes" columns="3" gutter_space="20" heading_type="h2" layout="masonry" template="box" excerpt_length="30"][/wc_posts]');
181
  }
182
  },
183
  {
184
  text: "Masonry - Borderless",
185
  onclick: function(){
186
- editor.insertContent('[wc_posts author="" author_name="" p="" post__in="" order="DESC" orderby="date" post_status="publish" post_type="post" posts_per_page="10" taxonomy="" field="slug" terms="" title="yes" meta_all="yes" meta_author="yes" meta_date="yes" date_format="M j, Y" meta_comments="yes" thumbnail="yes" content="yes" paging="yes" size="large" filtering="yes" columns="3" gutter_space="40" heading_type="h2" layout="masonry" template="borderless" excerpt_length="30"][/wc_posts]');
187
  }
188
  },
189
  {
190
  text: "Grid - Box",
191
  onclick: function(){
192
- editor.insertContent('[wc_posts author="" author_name="" p="" post__in="" order="DESC" orderby="date" post_status="publish" post_type="post" posts_per_page="10" taxonomy="" field="slug" terms="" title="yes" meta_all="yes" meta_author="yes" meta_date="yes" date_format="M j, Y" meta_comments="yes" thumbnail="yes" content="yes" paging="yes" size="wccarousel" filtering="yes" columns="3" gutter_space="20" heading_type="h2" layout="grid" template="box" excerpt_length="15"][/wc_posts]');
193
  }
194
  },
195
  {
196
  text: "Grid - Borderless",
197
  onclick: function(){
198
- editor.insertContent('[wc_posts author="" author_name="" p="" post__in="" order="DESC" orderby="date" post_status="publish" post_type="post" posts_per_page="10" taxonomy="" field="slug" terms="" title="yes" meta_all="yes" meta_author="yes" meta_date="yes" date_format="M j, Y" meta_comments="yes" thumbnail="yes" content="yes" paging="yes" size="wccarousel" filtering="yes" columns="3" gutter_space="40" heading_type="h2" layout="grid" template="borderless" excerpt_length="15"][/wc_posts]');
199
  }
200
  },
201
  {
177
  {
178
  text: "Masonry - Box",
179
  onclick: function(){
180
+ editor.insertContent('[wc_posts pids="" order="DESC" orderby="date" post_type="post" taxonomy="" terms="" posts_per_page="10" ignore_sticky_posts="0" show_title="1" show_meta_all="1" show_meta_author="1" show_meta_date="1" show_meta_comments="1" show_thumbnail="1" show_content="1" show_paging="1" size="large" filtering="1" columns="3" gutter_space="20" heading_type="h2" layout="masonry" template="box" excerpt_length="30" date_format="M j, Y"][/wc_posts]');
181
  }
182
  },
183
  {
184
  text: "Masonry - Borderless",
185
  onclick: function(){
186
+ editor.insertContent('[wc_posts pids="" order="DESC" orderby="date" post_type="post" taxonomy="" terms="" posts_per_page="10" ignore_sticky_posts="0" show_title="1" show_meta_all="1" show_meta_author="1" show_meta_date="1" show_meta_comments="1" show_thumbnail="1" show_content="1" show_paging="1" size="large" filtering="1" columns="3" gutter_space="40" heading_type="h2" layout="masonry" template="borderless" excerpt_length="30" date_format="M j, Y"][/wc_posts]');
187
  }
188
  },
189
  {
190
  text: "Grid - Box",
191
  onclick: function(){
192
+ editor.insertContent('[wc_posts pids="" order="DESC" orderby="date" post_type="post" taxonomy="" terms="" posts_per_page="10" ignore_sticky_posts="0" show_title="1" show_meta_all="1" show_meta_author="1" show_meta_date="1" show_meta_comments="1" show_thumbnail="1" show_content="1" show_paging="1" size="wccarousel" filtering="1" columns="3" gutter_space="20" heading_type="h2" layout="grid" template="box" excerpt_length="15" date_format="M j, Y"][/wc_posts]');
193
  }
194
  },
195
  {
196
  text: "Grid - Borderless",
197
  onclick: function(){
198
+ editor.insertContent('[wc_posts pids="" order="DESC" orderby="date" post_type="post" taxonomy="" terms="" posts_per_page="10" ignore_sticky_posts="0" show_title="1" show_meta_all="1" show_meta_author="1" show_meta_date="1" show_meta_comments="1" show_thumbnail="1" show_content="1" show_paging="1" size="wccarousel" filtering="1" columns="3" gutter_space="40" heading_type="h2" layout="grid" template="borderless" excerpt_length="15" date_format="M j, Y"][/wc_posts]');
199
  }
200
  },
201
  {
admin/assets/js/wc-shortcodes.js CHANGED
@@ -32,7 +32,7 @@
32
  }
33
  var insertShortcode = function() {
34
  var data = $innerContent.serialize();
35
- var $fields = $innerContent.find("[name^='widget-wc_shortcodes_post_slider[]']");
36
 
37
  var values = new Array();
38
  $.each( $fields, function( i, el ) {
@@ -53,10 +53,10 @@
53
  key = key.substring( 0, key.length - 1 );
54
  values.push( key + '="' + val + '"' );
55
  });
56
- console.log(values);
57
  values = values.join(" ");
58
 
59
- var rgxp = new RegExp("^\\["+mceTag+"\\s+.+?\\]", "g");
60
  // console.log(rgxp);
61
 
62
  // var shortcode = "["+mceTag+" "+values+"][/"+mceTag+"]";
32
  }
33
  var insertShortcode = function() {
34
  var data = $innerContent.serialize();
35
+ var $fields = $innerContent.find(".wc-shortcodes-widget-option");
36
 
37
  var values = new Array();
38
  $.each( $fields, function( i, el ) {
53
  key = key.substring( 0, key.length - 1 );
54
  values.push( key + '="' + val + '"' );
55
  });
56
+ // console.log(values);
57
  values = values.join(" ");
58
 
59
+ var rgxp = new RegExp("^\\["+mceTag+"\\s*.*?\\]", "g");
60
  // console.log(rgxp);
61
 
62
  // var shortcode = "["+mceTag+" "+values+"][/"+mceTag+"]";
admin/assets/js/{wcpostsliderwidget.js → wcpostswidget.js} RENAMED
@@ -3,7 +3,7 @@
3
 
4
  $.fn.extend({
5
  // change 'pluginname' to your plugin name (duh)
6
- wcPostSliderWidget: function(options) {
7
  // options for the plugin
8
  var defaults = {
9
  postTypeSelector: '.wc-shortcodes-widget-post-type-selector',
3
 
4
  $.fn.extend({
5
  // change 'pluginname' to your plugin name (duh)
6
+ wcPostsWidget: function(options) {
7
  // options for the plugin
8
  var defaults = {
9
  postTypeSelector: '.wc-shortcodes-widget-post-type-selector',
admin/class-admin.php CHANGED
@@ -72,8 +72,8 @@ class WPC_Shortcodes_Admin extends WPC_Shortcodes_Vars {
72
  if ( $hook == 'post-new.php' || $hook == 'post.php' || $hook == 'widgets.php' ) {
73
  wp_enqueue_style( 'wc-shortcodes-admin-style', WC_SHORTCODES_PLUGIN_URL . 'admin/assets/css/wc-shortcodes.css', array( ), $ver );
74
  wp_enqueue_style( 'wc-shortcodes-ui-theme-override-style', WC_SHORTCODES_PLUGIN_URL . 'admin/assets/css/ui-theme-override.css', array( ), $ver );
75
- wp_enqueue_style( 'wc-shortcodes-post-slider-widget-style', WC_SHORTCODES_PLUGIN_URL . 'admin/assets/css/wcpostsliderwidget.css', array( ), $ver );
76
- wp_enqueue_script( 'wc-shortcodes-post-slider-widget', WC_SHORTCODES_PLUGIN_URL . 'admin/assets/js/wcpostsliderwidget.js', array ( 'jquery', 'jquery-ui-autocomplete', 'jquery-ui-accordion' ), $ver, true );
77
  wp_enqueue_script( 'wc-shortcodes', WC_SHORTCODES_PLUGIN_URL . 'admin/assets/js/wc-shortcodes.js', array ( 'jquery' ), $ver, true );
78
  }
79
  }
72
  if ( $hook == 'post-new.php' || $hook == 'post.php' || $hook == 'widgets.php' ) {
73
  wp_enqueue_style( 'wc-shortcodes-admin-style', WC_SHORTCODES_PLUGIN_URL . 'admin/assets/css/wc-shortcodes.css', array( ), $ver );
74
  wp_enqueue_style( 'wc-shortcodes-ui-theme-override-style', WC_SHORTCODES_PLUGIN_URL . 'admin/assets/css/ui-theme-override.css', array( ), $ver );
75
+ wp_enqueue_style( 'wc-shortcodes-posts-widget-style', WC_SHORTCODES_PLUGIN_URL . 'admin/assets/css/wcpostswidget.css', array( ), $ver );
76
+ wp_enqueue_script( 'wc-shortcodes-posts-widget', WC_SHORTCODES_PLUGIN_URL . 'admin/assets/js/wcpostswidget.js', array ( 'jquery', 'jquery-ui-autocomplete', 'jquery-ui-accordion' ), $ver, true );
77
  wp_enqueue_script( 'wc-shortcodes', WC_SHORTCODES_PLUGIN_URL . 'admin/assets/js/wc-shortcodes.js', array ( 'jquery' ), $ver, true );
78
  }
79
  }
admin/class-ajax.php CHANGED
@@ -135,6 +135,10 @@ class WPC_Shortcodes_Ajax {
135
  $widget = new WC_Shortcodes_Post_Slider_Widget();
136
  $widget->form( $attr );
137
  break;
 
 
 
 
138
  }
139
 
140
  die();
135
  $widget = new WC_Shortcodes_Post_Slider_Widget();
136
  $widget->form( $attr );
137
  break;
138
+ case 'wc_posts' :
139
+ $widget = new WC_Shortcodes_Posts_Widget();
140
+ $widget->form( $attr );
141
+ break;
142
  }
143
 
144
  die();
public/class-register.php CHANGED
@@ -14,8 +14,6 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
14
  }
15
 
16
  private function __construct() {
17
- $this->sanitize = WPC_Shortcodes_Sanitize::get_instance();
18
-
19
  add_filter( 'the_content', array( &$this, 'pre_process' ), 7 );
20
  add_filter( 'wc_shortcodes_the_content', array( &$this, 'pre_process' ), 7 );
21
  add_action( 'wc_shortcodes_add_preprocess', array( &$this, 'add_preprocess' ) );
@@ -138,7 +136,7 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
138
  ), $atts));
139
 
140
  // sanitize
141
- $name = $this->sanitize->text_field( $name );
142
  $name = preg_replace( '/^_/', '', $name );
143
 
144
  if ( empty( $name ) )
@@ -187,11 +185,11 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
187
  ), $atts));
188
 
189
  // sanitize
190
- $scrollable = $this->sanitize->bool( $scrollable );
191
- $color = $this->sanitize->bool( $color );
192
- $linenums = $this->sanitize->bool( $linenums );
193
- $wrap = $this->sanitize->bool( $wrap );
194
- $name = $this->sanitize->text_field( $name );
195
 
196
  $class = array();
197
  if ( (int) $color ) {
@@ -249,9 +247,9 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
249
  ), $atts ) );
250
 
251
  // sanitize
252
- $percentage = $this->sanitize->int_float( $percentage );
253
- $color = $this->sanitize->hex_color( $color );
254
- $show_percent = $this->sanitize->bool( $show_percent );
255
 
256
  // Enque scripts
257
  wp_enqueue_script('wc-shortcodes-skillbar');
@@ -280,7 +278,7 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
280
  ), $atts ) );
281
 
282
  // sanitize
283
- $size = $this->sanitize->css_unit( $size );
284
 
285
  return '<hr class="wc-shortcodes-spacing '. esc_attr( $class ) .'" style="height: '. esc_attr( $size ) .'" />';
286
  }
@@ -407,7 +405,7 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
407
  ), $atts ) );
408
 
409
  // sanitize
410
- $border_radius = $this->sanitize->css_unit( $border_radius );
411
 
412
  $custom_class = sanitize_title( $class );
413
 
@@ -459,8 +457,8 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
459
  'class' => '',
460
  ), $atts ) );
461
 
462
- $margin_top = $this->sanitize->css_unit( $margin_top );
463
- $margin_bottom = $this->sanitize->css_unit( $margin_bottom );
464
 
465
  $style_attr = '';
466
 
@@ -521,7 +519,7 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
521
  'class' => '',
522
  ), $atts ) );
523
 
524
- $max_width = $this->sanitize->css_unit( $max_width );
525
 
526
  // $append_clearfix = '<div class="wc-shortcodes-clear-floats"></div>';
527
  $style = empty( $max_width ) ? '' : ' style="max-width:'.esc_attr( $max_width ).';"';
@@ -586,7 +584,7 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
586
  'layout' => 'box',
587
  ), $atts ) );
588
 
589
- $padding = $this->sanitize->css_unit( $padding );
590
 
591
  $classes = array();
592
 
@@ -634,8 +632,8 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
634
  'layout' => 'box',
635
  ), $atts ) );
636
 
637
- $collapse = $this->sanitize->bool( $collapse );
638
- $leaveopen = $this->sanitize->bool( $leaveopen );
639
 
640
  $classes = array();
641
 
@@ -813,7 +811,7 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
813
  'icon_spacing' => '',
814
  ), $atts ) );
815
 
816
- $type = $this->sanitize->heading_type( $type );
817
 
818
  $style_attr = '';
819
 
@@ -875,8 +873,8 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
875
  'class' => '', // add a custom class to your google map
876
  ), $atts));
877
 
878
- $height = $this->sanitize->pixel( $height );
879
- $zoom = $this->sanitize->number( $zoom );
880
 
881
  $title_on_load = 'yes' == $title_on_load ? 1 : 0;
882
 
@@ -913,8 +911,8 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
913
  'class' => '',
914
  ), $atts ) );
915
 
916
- $margin_top = $this->sanitize->css_unit( $margin_top );
917
- $margin_bottom = $this->sanitize->css_unit( $margin_bottom );
918
 
919
  $style_attr = array();
920
 
@@ -977,7 +975,7 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
977
 
978
  wp_enqueue_script('wc-shortcodes-rsvp');
979
 
980
- $columns = $this->sanitize->positive_number( $columns );
981
  $columns = 3 == $columns ? $columns : 1;
982
 
983
  $html = '';
@@ -1062,61 +1060,50 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
1062
  static $instance = 0;
1063
  $instance++;
1064
 
 
 
 
 
 
1065
  if ( (is_front_page() || is_home() ) ) {
1066
- $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : ( ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1 );
1067
  } else {
1068
- $paged = ( get_query_var('paged') ) ? get_query_var( 'paged' ) : 1;
1069
  }
1070
 
1071
- $atts = shortcode_atts( array(
1072
- 'author' => '', //use author id
1073
- 'author_name' => '', //use 'user_nicename' (NOT name).
1074
- 'p' => false, //use post id.
1075
- 'post__in' => false, //use post ids
1076
- 'order' => 'DESC', // DESC, ASC
1077
- 'orderby' => 'date',
1078
- 'post_status' => 'publish',
1079
- 'post_type' => 'post', // post, page, wc_portfolio_item, etc
1080
- 'posts_per_page' => 10, //number of post to show per page
1081
- 'nopaging' => false, //show all posts or use pagination. Default value is 'false', use paging.
1082
- 'paged' => $paged, // number of page. Show the posts that would normally show up just on page X when using the "Older Entries" link.
1083
- 'ignore_sticky_posts' => 0,
1084
-
1085
- 'taxonomy' => '', // category, post_tag, wc_portfolio_tag, etc
1086
- 'field' => 'slug', // slug or id
1087
- 'terms' => '', // taxonomy terms.
1088
-
1089
- 'title' => true, // show heading?
1090
- 'meta_all' => true, // show all meta info?
1091
- 'meta_author' => true, // show author?
1092
- 'meta_date' => true, // show date?
1093
- 'meta_comments' => true, // show comments?
1094
- 'thumbnail' => true, // show thumbnail?
1095
- 'content' => true, // show main content?
1096
- 'paging' => true, // show pagination navigation?
1097
-
1098
- 'size' => 'large', // default thumbnail size
1099
-
1100
- 'filtering' => true, // insert isotope filter navigation
1101
- 'columns' => '3', // default number of isotope columns
1102
- 'gutter_space' => '20', // gutter width percentage relative to parent element width
1103
- 'heading_type' => 'h2', // heading tag for title
1104
- 'layout' => 'masonry', // blog layout
1105
- 'template' => 'box',
1106
- 'excerpt_length' => '55',
1107
- 'date_format' => 'M j, Y',
1108
- ), $atts );
1109
 
1110
  // fix bug with title argument being added to WP_Query() in 4.4
1111
  $keys = array(
1112
- 'title',
1113
- 'meta_all',
1114
- 'meta_author',
1115
- 'meta_date',
1116
- 'meta_comments',
1117
- 'thumbnail',
1118
- 'content',
1119
- 'paging',
1120
  'size',
1121
  'filtering',
1122
  'columns',
@@ -1134,48 +1121,10 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
1134
  unset( $atts[ $key ] );
1135
  }
1136
 
1137
- // changed default layout name. Let's catch old inputs
1138
- $valid_layouts = array( 'masonry', 'grid' );
1139
- if ( ! in_array( $display['layout'], $valid_layouts ) ) {
1140
- $display['layout'] = "masonry";
1141
- }
1142
-
1143
- $valid_templates = array( 'box', 'borderless' );
1144
- if ( ! in_array( $display['template'], $valid_templates ) ) {
1145
- $display['template'] = "box";
1146
- }
1147
-
1148
- // clean input values
1149
- $atts['terms'] = $this->sanitize->comma_delim_to_array( $atts['terms'] );
1150
  $wpc_term = null;
1151
  if ( isset( $_GET['wpc_term'] ) && ! empty( $_GET['wpc_term'] ) ) {
1152
  $wpc_term = $_GET['wpc_term'];
1153
  }
1154
- $atts['post__in'] = $this->sanitize->comma_delim_to_array( $atts['post__in'] );
1155
- $display['columns'] == (int) $display['columns'];
1156
- $display['excerpt_length'] = (int) $display['excerpt_length'];
1157
- $atts['order'] = strtoupper( $atts['order'] );
1158
- $display['heading_type'] = strtolower( $display['heading_type'] );
1159
-
1160
- if ( ! is_numeric( $display['gutter_space'] ) ) {
1161
- $display['gutter_space'] = 20;
1162
- }
1163
- if ( $display['gutter_space'] > 0 && $display['gutter_space'] < 1 ) {
1164
- $display['gutter_space'] = (int) ( $display['gutter_space'] * 1000 );
1165
- }
1166
- $display['gutter_space'] = (int) $display['gutter_space'];
1167
- if ( $display['gutter_space'] > 50 || $display['gutter_space'] < 0 ) {
1168
- $display['gutter_space'] = 20;
1169
- }
1170
-
1171
- if (isset($atts['posts_per_page']) && $atts['posts_per_page']) {
1172
- $atts['posts_per_page'] = (int) $atts['posts_per_page'];
1173
- }
1174
- else {
1175
- $atts['posts_per_page'] = 0;
1176
- }
1177
-
1178
-
1179
 
1180
  // add tax query if user specified
1181
  if ( ! empty( $wpc_term ) ) {
@@ -1197,32 +1146,6 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
1197
  );
1198
  }
1199
 
1200
- // no paging needed when showing all posts
1201
- if(isset($atts['posts_per_page']) && $atts['posts_per_page'] == -1) {
1202
- $atts['nopaging'] = true;
1203
- }
1204
-
1205
- // setting attributes right for the php script
1206
- $valid_headings = array( 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' );
1207
- $display['heading_type'] = in_array( $display['heading_type'], $valid_headings ) ? $display['heading_type'] : 'h2';
1208
-
1209
- $valid_columns = array( 1, 2, 3, 4, 5, 6, 7, 8, 9 );
1210
- $display['columns'] = in_array( $display['columns'], $valid_columns ) ? $display['columns'] : 2;
1211
- if ( $display['columns'] == 1 ) {
1212
- $display['layout'] = 'single-column';
1213
- }
1214
-
1215
- ($display['title'] == "yes") ? ($display['title'] = true) : ($display['title'] = false);
1216
- ($display['meta_all'] == "yes") ? ($display['meta_all'] = true) : ($display['meta_all'] = false);
1217
- ($display['meta_author'] == "yes") ? ($display['meta_author'] = true) : ($display['meta_author'] = false);
1218
- ($display['meta_date'] == "yes") ? ($display['meta_date'] = true) : ($display['meta_date'] = false);
1219
- ($display['meta_comments'] == "yes") ? ($display['meta_comments'] = true) : ($display['meta_comments'] = false);
1220
- ($display['thumbnail'] == "yes") ? ($display['thumbnail'] = true) : ($display['thumbnail'] = false);
1221
- ($display['content'] == "yes") ? ($display['content'] = true) : ($display['content'] = false);
1222
- ($display['paging'] == "yes" && ! $atts['nopaging']) ? ($display['paging'] = true) : ($display['paging'] = false);
1223
- ($display['filtering'] == "yes") ? ($display['filtering'] = true) : ($display['filtering'] = false);
1224
- ($atts['order'] == "ASC") ? ($atts['order'] = "ASC") : ($atts['order'] = "DESC");
1225
-
1226
  $is_masonry = 'masonry' == $display['layout'] ? true : false;
1227
  $is_grid = 'grid' == $display['layout'] ? true : false;
1228
 
@@ -1234,7 +1157,7 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
1234
  }
1235
 
1236
  $nav_filter_hard_links = false;
1237
- if ( $display['paging'] ) {
1238
  $nav_filter_hard_links = true;
1239
  }
1240
 
@@ -1265,7 +1188,7 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
1265
  while( $wc_shortcodes_posts_query->have_posts() ) :
1266
  $wc_shortcodes_posts_query->the_post();
1267
 
1268
- if ( $display['content'] && empty( $post->post_excerpt ) && empty( $post->post_content ) )
1269
  $display['content'] = false;
1270
 
1271
  ob_start();
@@ -1278,7 +1201,7 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
1278
  $html .= '</div>';
1279
 
1280
  //no paging if only the latest posts are shown
1281
- if ( $display['paging'] ) {
1282
  ob_start();
1283
  include('templates/nav-pagination.php');
1284
  $html .= ob_get_clean();
@@ -1288,151 +1211,36 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
1288
  }
1289
 
1290
  public function post_slider( $atts ) {
1291
- global $data;
1292
  global $post;
1293
  global $wc_shortcodes_posts_query;
1294
 
1295
  static $instance = 0;
1296
  $instance++;
1297
 
1298
- $atts = shortcode_atts( array(
1299
- 'author' => '', //use author id
1300
- 'author_name' => '', //use 'user_nicename' (NOT name).
1301
- 'pids' => '', //use post id.
1302
- 'p' => '', //use post id.
1303
- 'post__in' => '', //use post ids
1304
- 'order' => 'DESC', // DESC, ASC
1305
- 'orderby' => 'date',
1306
- 'post_status' => 'publish',
1307
- 'post_type' => 'post', // post, page, wc_portfolio_item, etc
1308
- 'posts_per_page' => 10, //number of post to show per page
1309
- 'nopaging' => false, //show all posts or use pagination. Default value is 'false', use paging.
1310
- 'ignore_sticky_posts' => 1,
1311
-
1312
- 'taxonomy' => '', // category, post_tag, wc_portfolio_tag, etc
1313
- 'field' => 'slug', // slug or id
1314
- 'terms' => '', // taxonomy terms.
1315
-
1316
- 'show_meta_category' => 1, // show heading?
1317
- 'show_title' => 1, // show heading?
1318
- 'show_content' => 1, // show main content?
1319
- 'readmore' => 'Continue Reading', // show main content?
1320
- 'button_class' => 'button secondary-button', // show main content?
1321
-
1322
- 'size' => 'full', // default thumbnail size
1323
-
1324
- 'heading_type' => 'h2', // heading tag for title
1325
- 'heading_size' => 30,
1326
- 'mobile_heading_size' => 24,
1327
- 'layout' => 'bxslider', // blog layout
1328
- 'template' => 'slider2',
1329
- 'excerpt_length' => 55,
1330
- 'desktop_height' => 600,
1331
- 'laptop_height' => 500,
1332
- 'mobile_height' => 350,
1333
-
1334
- 'slider_mode' => 'fade',
1335
- 'slider_pause' => 4000,
1336
- 'slider_auto' => 0,
1337
- ), $atts );
1338
-
1339
- // sanitize bools
1340
- $bools = array( 'ignore_sticky_posts', 'show_meta_category', 'show_title', 'show_content', 'slider_auto' );
1341
- foreach ( $bools as $key ) {
1342
- if ( isset( $atts[ $key ] ) ) {
1343
- if ( "no" == $key ) {
1344
- $atts[ $key ] = 0;
1345
- }
1346
- else {
1347
- $atts[ $key ] = (bool) $atts[ $key ];
1348
- $atts[ $key ] = $atts[ $key ] ? 1 : 0;
1349
- }
1350
- }
1351
- }
1352
 
1353
- // sanitize ints
1354
- $ints = array( 'p', 'posts_per_page', 'heading_size', 'mobile_heading_size', 'excerpt_length', 'desktop_height', 'laptop_height', 'mobile_height', 'slider_pause' );
1355
- foreach ( $ints as $key ) {
1356
- if ( isset( $atts[ $key ] ) ) {
1357
- $atts[ $key ] = (int) $atts[ $key ];
1358
- }
1359
- }
1360
- $atts['slider_pause'] = abs( $atts['slider_pause'] );
1361
-
1362
- $pids = explode( ',', $atts['pids'] );
1363
- $p = array();
1364
- if ( ! empty( $pids ) ) {
1365
- foreach ( $pids as $id ) {
1366
- $id = (int) $id;
1367
- if ( ! empty( $id ) ) {
1368
- $p[] = $id;
1369
- }
1370
- }
1371
 
 
1372
  $size = sizeof( $p );
1373
  if ( 1 < $size ) {
1374
- $atts['p'] = '';
1375
  $atts['post__in'] = $p;
1376
  }
1377
  else if ( 1 == $size ) {
1378
  $atts['p'] = $p[0];
1379
- $atts['post__in'] = '';
1380
  }
1381
- else {
1382
- $atts['p'] = '';
1383
- $atts['post__in'] = '';
1384
- }
1385
- }
1386
-
1387
- // sanitize limit
1388
- if ( $atts['posts_per_page'] < 0 ) {
1389
- $atts['posts_per_page'] = -1;
1390
- $atts['nopaging'] = true;
1391
- }
1392
- else if ( 0 == $atts['posts_per_page'] ) {
1393
- return;
1394
- }
1395
-
1396
- // sanitize dropdown
1397
- $valid_layouts = array( 'bxslider' );
1398
- if ( ! in_array( $atts['layout'], $valid_layouts ) ) {
1399
- $atts['layout'] = 'bxslider';
1400
  }
1401
 
1402
- $valid_templates = array( 'slider1', 'slider2' );
1403
- if ( ! in_array( $atts['template'], $valid_templates ) ) {
1404
- $atts['template'] = 'slider1';
1405
- }
1406
 
1407
- $valid_slider_modes = array( 'fade', 'vertical', 'horizontal' );
1408
- if ( ! in_array( $atts['slider_mode'], $valid_slider_modes ) ) {
1409
- $atts['slider_mode'] = 'fade';
1410
- }
1411
-
1412
- $valid_orders = array( 'ASC', 'DESC' );
1413
- $atts['order'] = strtoupper( $atts['order'] );
1414
- if ( ! in_array( $atts['order'], $valid_orders ) ) {
1415
- $atts['order'] = 'DESC';
1416
- }
1417
-
1418
- $atts['heading_type'] = strtolower( $atts['heading_type'] );
1419
- $valid_headings = array( 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' );
1420
- $atts['heading_type'] = in_array( $atts['heading_type'], $valid_headings ) ? $atts['heading_type'] : 'h2';
1421
-
1422
- // sanitize inputs
1423
- $atts['button_class'] = trim( $atts['button_class'] );
1424
- $atts['button_class'] = empty( $atts['button_class'] ) ? 'wc-shortcodes-post-slide-button' : $atts['button_class'];
1425
-
1426
- $terms = explode( ',', trim( $atts['terms'] ) );
1427
- $t = array();
1428
- if ( ! empty( $terms ) ) {
1429
- foreach ( $terms as $term ) {
1430
- $term = trim( $term );
1431
- if ( ! empty( $term ) ) {
1432
- $t[] = $term;
1433
- }
1434
- }
1435
- $atts['terms'] = $t;
1436
  }
1437
 
1438
  // fix bug with title argument being added to WP_Query() in 4.4
@@ -1570,14 +1378,14 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
1570
  'class' => '',
1571
  ), $atts ) );
1572
 
1573
- $font_size = $this->sanitize->css_unit( $font_size );
1574
- $flag_width = $this->sanitize->css_unit( $flag_width );
1575
 
1576
  // function options
1577
  $div_wrapper = false;
1578
 
1579
  // sanitize
1580
- $attachment_id = $this->sanitize->number( $attachment_id );
1581
 
1582
  // classes
1583
  $classes = array();
@@ -1673,8 +1481,8 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
1673
  'class' => '',
1674
  ), $atts ) );
1675
 
1676
- $margin_right = $this->sanitize->css_unit( $margin_right );
1677
- $margin_left = $this->sanitize->css_unit( $margin_left );
1678
 
1679
  if ( empty( $icon ) )
1680
  return '';
14
  }
15
 
16
  private function __construct() {
 
 
17
  add_filter( 'the_content', array( &$this, 'pre_process' ), 7 );
18
  add_filter( 'wc_shortcodes_the_content', array( &$this, 'pre_process' ), 7 );
19
  add_action( 'wc_shortcodes_add_preprocess', array( &$this, 'add_preprocess' ) );
136
  ), $atts));
137
 
138
  // sanitize
139
+ $name = WPC_Shortcodes_Sanitize::text_field( $name );
140
  $name = preg_replace( '/^_/', '', $name );
141
 
142
  if ( empty( $name ) )
185
  ), $atts));
186
 
187
  // sanitize
188
+ $scrollable = WPC_Shortcodes_Sanitize::bool( $scrollable );
189
+ $color = WPC_Shortcodes_Sanitize::bool( $color );
190
+ $linenums = WPC_Shortcodes_Sanitize::bool( $linenums );
191
+ $wrap = WPC_Shortcodes_Sanitize::bool( $wrap );
192
+ $name = WPC_Shortcodes_Sanitize::text_field( $name );
193
 
194
  $class = array();
195
  if ( (int) $color ) {
247
  ), $atts ) );
248
 
249
  // sanitize
250
+ $percentage = WPC_Shortcodes_Sanitize::int_float( $percentage );
251
+ $color = WPC_Shortcodes_Sanitize::hex_color( $color );
252
+ $show_percent = WPC_Shortcodes_Sanitize::bool( $show_percent );
253
 
254
  // Enque scripts
255
  wp_enqueue_script('wc-shortcodes-skillbar');
278
  ), $atts ) );
279
 
280
  // sanitize
281
+ $size = WPC_Shortcodes_Sanitize::css_unit( $size );
282
 
283
  return '<hr class="wc-shortcodes-spacing '. esc_attr( $class ) .'" style="height: '. esc_attr( $size ) .'" />';
284
  }
405
  ), $atts ) );
406
 
407
  // sanitize
408
+ $border_radius = WPC_Shortcodes_Sanitize::css_unit( $border_radius );
409
 
410
  $custom_class = sanitize_title( $class );
411
 
457
  'class' => '',
458
  ), $atts ) );
459
 
460
+ $margin_top = WPC_Shortcodes_Sanitize::css_unit( $margin_top );
461
+ $margin_bottom = WPC_Shortcodes_Sanitize::css_unit( $margin_bottom );
462
 
463
  $style_attr = '';
464
 
519
  'class' => '',
520
  ), $atts ) );
521
 
522
+ $max_width = WPC_Shortcodes_Sanitize::css_unit( $max_width );
523
 
524
  // $append_clearfix = '<div class="wc-shortcodes-clear-floats"></div>';
525
  $style = empty( $max_width ) ? '' : ' style="max-width:'.esc_attr( $max_width ).';"';
584
  'layout' => 'box',
585
  ), $atts ) );
586
 
587
+ $padding = WPC_Shortcodes_Sanitize::css_unit( $padding );
588
 
589
  $classes = array();
590
 
632
  'layout' => 'box',
633
  ), $atts ) );
634
 
635
+ $collapse = WPC_Shortcodes_Sanitize::bool( $collapse );
636
+ $leaveopen = WPC_Shortcodes_Sanitize::bool( $leaveopen );
637
 
638
  $classes = array();
639
 
811
  'icon_spacing' => '',
812
  ), $atts ) );
813
 
814
+ $type = WPC_Shortcodes_Sanitize::heading_type( $type );
815
 
816
  $style_attr = '';
817
 
873
  'class' => '', // add a custom class to your google map
874
  ), $atts));
875
 
876
+ $height = WPC_Shortcodes_Sanitize::pixel( $height );
877
+ $zoom = WPC_Shortcodes_Sanitize::number( $zoom );
878
 
879
  $title_on_load = 'yes' == $title_on_load ? 1 : 0;
880
 
911
  'class' => '',
912
  ), $atts ) );
913
 
914
+ $margin_top = WPC_Shortcodes_Sanitize::css_unit( $margin_top );
915
+ $margin_bottom = WPC_Shortcodes_Sanitize::css_unit( $margin_bottom );
916
 
917
  $style_attr = array();
918
 
975
 
976
  wp_enqueue_script('wc-shortcodes-rsvp');
977
 
978
+ $columns = WPC_Shortcodes_Sanitize::positive_number( $columns );
979
  $columns = 3 == $columns ? $columns : 1;
980
 
981
  $html = '';
1060
  static $instance = 0;
1061
  $instance++;
1062
 
1063
+ $atts = WPC_Shortcodes_Sanitize::posts_attr_key_change( $atts );
1064
+ $atts = shortcode_atts( parent::$attr->posts, $atts );
1065
+ $atts = WPC_Shortcodes_Sanitize::posts_attr( $atts );
1066
+
1067
+ // Set paged variable.
1068
  if ( (is_front_page() || is_home() ) ) {
1069
+ $atts['paged'] = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : ( ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1 );
1070
  } else {
1071
+ $atts['paged'] = ( get_query_var('paged') ) ? get_query_var( 'paged' ) : 1;
1072
  }
1073
 
1074
+ // Convert comma delimeted string to array
1075
+ $p = WPC_Shortcodes_Sanitize::comma_delim_to_array( $atts['pids'] );
1076
+
1077
+ $atts['p'] = '';
1078
+ $atts['post__in'] = '';
1079
+
1080
+ if ( is_array( $p ) && ! empty( $p ) ) {
1081
+ $size = sizeof( $p );
1082
+ if ( 1 < $size ) {
1083
+ $atts['post__in'] = $p;
1084
+ }
1085
+ else if ( 1 == $size ) {
1086
+ $atts['p'] = $p[0];
1087
+ }
1088
+ }
1089
+
1090
+ $atts['terms'] = WPC_Shortcodes_Sanitize::comma_delim_to_array( $atts['terms'] );
1091
+
1092
+ // Return if posts_per_page is set to 0.
1093
+ if ( 0 == $atts['posts_per_page'] ) {
1094
+ return;
1095
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1096
 
1097
  // fix bug with title argument being added to WP_Query() in 4.4
1098
  $keys = array(
1099
+ 'show_title',
1100
+ 'show_meta_all',
1101
+ 'show_meta_author',
1102
+ 'show_meta_date',
1103
+ 'show_meta_comments',
1104
+ 'show_thumbnail',
1105
+ 'show_content',
1106
+ 'show_paging',
1107
  'size',
1108
  'filtering',
1109
  'columns',
1121
  unset( $atts[ $key ] );
1122
  }
1123
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1124
  $wpc_term = null;
1125
  if ( isset( $_GET['wpc_term'] ) && ! empty( $_GET['wpc_term'] ) ) {
1126
  $wpc_term = $_GET['wpc_term'];
1127
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1128
 
1129
  // add tax query if user specified
1130
  if ( ! empty( $wpc_term ) ) {
1146
  );
1147
  }
1148
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1149
  $is_masonry = 'masonry' == $display['layout'] ? true : false;
1150
  $is_grid = 'grid' == $display['layout'] ? true : false;
1151
 
1157
  }
1158
 
1159
  $nav_filter_hard_links = false;
1160
+ if ( $display['show_paging'] ) {
1161
  $nav_filter_hard_links = true;
1162
  }
1163
 
1188
  while( $wc_shortcodes_posts_query->have_posts() ) :
1189
  $wc_shortcodes_posts_query->the_post();
1190
 
1191
+ if ( $display['show_content'] && empty( $post->post_excerpt ) && empty( $post->post_content ) )
1192
  $display['content'] = false;
1193
 
1194
  ob_start();
1201
  $html .= '</div>';
1202
 
1203
  //no paging if only the latest posts are shown
1204
+ if ( $display['show_paging'] ) {
1205
  ob_start();
1206
  include('templates/nav-pagination.php');
1207
  $html .= ob_get_clean();
1211
  }
1212
 
1213
  public function post_slider( $atts ) {
 
1214
  global $post;
1215
  global $wc_shortcodes_posts_query;
1216
 
1217
  static $instance = 0;
1218
  $instance++;
1219
 
1220
+ $atts = shortcode_atts( parent::$attr->post_slider, $atts );
1221
+ $atts = WPC_Shortcodes_Sanitize::post_slider_attr( $atts );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1222
 
1223
+ // Convert comma delimeted string to array
1224
+ $p = WPC_Shortcodes_Sanitize::comma_delim_to_array( $atts['pids'] );
1225
+
1226
+ $atts['p'] = '';
1227
+ $atts['post__in'] = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
1228
 
1229
+ if ( is_array( $p ) && ! empty( $p ) ) {
1230
  $size = sizeof( $p );
1231
  if ( 1 < $size ) {
 
1232
  $atts['post__in'] = $p;
1233
  }
1234
  else if ( 1 == $size ) {
1235
  $atts['p'] = $p[0];
 
1236
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1237
  }
1238
 
1239
+ $atts['terms'] = WPC_Shortcodes_Sanitize::comma_delim_to_array( $atts['terms'] );
 
 
 
1240
 
1241
+ // Return if posts_per_page is set to 0.
1242
+ if ( 0 == $atts['posts_per_page'] ) {
1243
+ return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1244
  }
1245
 
1246
  // fix bug with title argument being added to WP_Query() in 4.4
1378
  'class' => '',
1379
  ), $atts ) );
1380
 
1381
+ $font_size = WPC_Shortcodes_Sanitize::css_unit( $font_size );
1382
+ $flag_width = WPC_Shortcodes_Sanitize::css_unit( $flag_width );
1383
 
1384
  // function options
1385
  $div_wrapper = false;
1386
 
1387
  // sanitize
1388
+ $attachment_id = WPC_Shortcodes_Sanitize::number( $attachment_id );
1389
 
1390
  // classes
1391
  $classes = array();
1481
  'class' => '',
1482
  ), $atts ) );
1483
 
1484
+ $margin_right = WPC_Shortcodes_Sanitize::css_unit( $margin_right );
1485
+ $margin_left = WPC_Shortcodes_Sanitize::css_unit( $margin_left );
1486
 
1487
  if ( empty( $icon ) )
1488
  return '';
public/class-sanitize.php CHANGED
@@ -3,22 +3,7 @@
3
  * Sanitize Class
4
  */
5
  class WPC_Shortcodes_Sanitize {
6
- protected static $instance = null;
7
-
8
- public static function get_instance() {
9
-
10
- // If the single instance hasn't been set, set it now.
11
- if ( null == self::$instance ) {
12
- self::$instance = new self;
13
- }
14
-
15
- return self::$instance;
16
- }
17
-
18
- private function __construct() {
19
- }
20
-
21
- public function bool( $value ) {
22
  if ( 'true' == $value ) {
23
  return true;
24
  }
@@ -29,17 +14,17 @@ class WPC_Shortcodes_Sanitize {
29
  return (bool) $value;
30
  }
31
 
32
- public function text_field( $value ) {
33
  return trim( sanitize_text_field( $value ) );
34
  }
35
 
36
- public function int_float( $value ) {
37
  $value = filter_var( $value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION );
38
 
39
  return $value;
40
  }
41
 
42
- public function positive_number( $value ) {
43
  $value = preg_replace("/[^0-9\-]/", "",$value);
44
  $value = intval( $value );
45
 
@@ -52,7 +37,7 @@ class WPC_Shortcodes_Sanitize {
52
  return $value;
53
  }
54
 
55
- public function number( $value ) {
56
  $value = preg_replace("/[^0-9\-]/", "",$value);
57
  $value = intval( $value );
58
 
@@ -62,7 +47,7 @@ class WPC_Shortcodes_Sanitize {
62
  return $value;
63
  }
64
 
65
- public function pixel( $value ) {
66
  if ( '' == $value )
67
  return $value;
68
 
@@ -75,7 +60,7 @@ class WPC_Shortcodes_Sanitize {
75
  return $value."px";
76
  }
77
 
78
- public function css_unit( $value, $css_unit = 'px' ) {
79
  if ( '' == $value )
80
  return $value;
81
 
@@ -91,7 +76,7 @@ class WPC_Shortcodes_Sanitize {
91
  return $value . $css_unit;
92
  }
93
 
94
- public function hex_color( $color ) {
95
  if ( '' === $color )
96
  return '';
97
 
@@ -102,7 +87,7 @@ class WPC_Shortcodes_Sanitize {
102
  return '';
103
  }
104
 
105
- public function heading_type( $value, $default = 'h2' ) {
106
  $whitelist = array(
107
  'h1',
108
  'h2',
@@ -120,21 +105,192 @@ class WPC_Shortcodes_Sanitize {
120
 
121
  return $default;
122
  }
123
- public function comma_delim_to_array( $string ) {
124
  $a = explode( ',', $string );
 
125
 
126
  foreach ( $a as $key => $value ) {
127
  $value = trim( $value );
128
-
129
- if ( empty( $value ) )
130
- unset( $a[ $key ] );
131
- else
132
- $a[ $key ] = $value;
133
  }
134
 
135
- if ( empty( $a ) )
136
  return '';
137
- else
138
- return $a;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  }
140
  }
3
  * Sanitize Class
4
  */
5
  class WPC_Shortcodes_Sanitize {
6
+ public static function bool( $value ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  if ( 'true' == $value ) {
8
  return true;
9
  }
14
  return (bool) $value;
15
  }
16
 
17
+ public static function text_field( $value ) {
18
  return trim( sanitize_text_field( $value ) );
19
  }
20
 
21
+ public static function int_float( $value ) {
22
  $value = filter_var( $value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION );
23
 
24
  return $value;
25
  }
26
 
27
+ public static function positive_number( $value ) {
28
  $value = preg_replace("/[^0-9\-]/", "",$value);
29
  $value = intval( $value );
30
 
37
  return $value;
38
  }
39
 
40
+ public static function number( $value ) {
41
  $value = preg_replace("/[^0-9\-]/", "",$value);
42
  $value = intval( $value );
43
 
47
  return $value;
48
  }
49
 
50
+ public static function pixel( $value ) {
51
  if ( '' == $value )
52
  return $value;
53
 
60
  return $value."px";
61
  }
62
 
63
+ public static function css_unit( $value, $css_unit = 'px' ) {
64
  if ( '' == $value )
65
  return $value;
66
 
76
  return $value . $css_unit;
77
  }
78
 
79
+ public static function hex_color( $color ) {
80
  if ( '' === $color )
81
  return '';
82
 
87
  return '';
88
  }
89
 
90
+ public static function heading_type( $value, $default = 'h2' ) {
91
  $whitelist = array(
92
  'h1',
93
  'h2',
105
 
106
  return $default;
107
  }
108
+ public static function comma_delim_to_array( $string ) {
109
  $a = explode( ',', $string );
110
+ $t = array();
111
 
112
  foreach ( $a as $key => $value ) {
113
  $value = trim( $value );
114
+ if ( ! empty( $value ) ) {
115
+ $t[] = $value;
116
+ }
 
 
117
  }
118
 
119
+ if ( empty( $t ) ) {
120
  return '';
121
+ }
122
+ else {
123
+ return $t;
124
+ }
125
+ }
126
+
127
+ public static function posts_attr_key_change( $atts ) {
128
+ // Rename keys in shortcode options.
129
+ $renamed = array( 'title', 'meta_all', 'meta_author', 'meta_date', 'meta_comments', 'thumbnail', 'content', 'paging' );
130
+ foreach ( $renamed as $key ) {
131
+ if ( isset( $atts[ $key ] ) ) {
132
+ $new_key = 'show_' . $key;
133
+ if ( ! isset( $atts[ $new_key ] ) ) {
134
+ $atts[ $new_key ] = $atts[ $key ];
135
+ }
136
+ unset( $atts[ $key ] );
137
+ }
138
+ }
139
+
140
+ return $atts;
141
+ }
142
+
143
+ public static function posts_attr( $atts, $empty_is_false = false ) {
144
+ // sanitize bools
145
+ $bools = array( 'ignore_sticky_posts', 'show_meta_category', 'nopaging', 'show_title', 'show_meta_all', 'show_meta_author', 'show_meta_date', 'show_meta_comments', 'show_thumbnail', 'show_content', 'show_paging', 'filtering' );
146
+ foreach ( $bools as $key ) {
147
+ if ( isset( $atts[ $key ] ) ) {
148
+ if ( "no" == $key ) {
149
+ $atts[ $key ] = 0;
150
+ }
151
+ else {
152
+ $atts[ $key ] = (bool) $atts[ $key ];
153
+ $atts[ $key ] = $atts[ $key ] ? 1 : 0;
154
+ }
155
+ }
156
+ else if ( $empty_is_false ) {
157
+ $atts[ $key ] = 0;
158
+ }
159
+ }
160
+
161
+ $atts['nopaging'] = (bool) $atts['nopaging'];
162
+
163
+ // gutter space
164
+ if ( ! is_numeric( $atts['gutter_space'] ) ) {
165
+ $atts['gutter_space'] = 20;
166
+ }
167
+ if ( $atts['gutter_space'] > 0 && $atts['gutter_space'] < 1 ) {
168
+ $atts['gutter_space'] = (int) ( $atts['gutter_space'] * 1000 );
169
+ }
170
+ $atts['gutter_space'] = (int) $atts['gutter_space'];
171
+ if ( $atts['gutter_space'] > 50 || $atts['gutter_space'] < 0 ) {
172
+ $atts['gutter_space'] = 20;
173
+ }
174
+
175
+ // sanitize ints
176
+ $ints = array( 'p', 'posts_per_page', 'columns', 'excerpt_length' );
177
+ foreach ( $ints as $key ) {
178
+ if ( isset( $atts[ $key ] ) ) {
179
+ $atts[ $key ] = (int) $atts[ $key ];
180
+ }
181
+ }
182
+
183
+ $valid_columns = array( 1, 2, 3, 4, 5, 6, 7, 8, 9 );
184
+ $atts['columns'] = in_array( $atts['columns'], $valid_columns ) ? $atts['columns'] : 2;
185
+ if ( $atts['columns'] == 1 ) {
186
+ $atts['layout'] = 'single-column';
187
+ }
188
+
189
+
190
+ // sanitize limit
191
+ if ( $atts['posts_per_page'] < 0 ) {
192
+ $atts['posts_per_page'] = -1;
193
+ $atts['nopaging'] = true;
194
+ }
195
+
196
+ // sanitize dropdown
197
+ $valid_layouts = array( 'masonry', 'grid', 'single-column' );
198
+ if ( ! in_array( $atts['layout'], $valid_layouts ) ) {
199
+ $atts['layout'] = 'masonry';
200
+ }
201
+
202
+ $valid_templates = array( 'box', 'borderless' );
203
+ if ( ! in_array( $atts['template'], $valid_templates ) ) {
204
+ $atts['template'] = 'box';
205
+ }
206
+
207
+ $valid_orders = array( 'ASC', 'DESC' );
208
+ $atts['order'] = strtoupper( $atts['order'] );
209
+ if ( ! in_array( $atts['order'], $valid_orders ) ) {
210
+ $atts['order'] = 'DESC';
211
+ }
212
+
213
+ $atts['heading_type'] = strtolower( $atts['heading_type'] );
214
+ $valid_headings = array( 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' );
215
+ $atts['heading_type'] = in_array( $atts['heading_type'], $valid_headings ) ? $atts['heading_type'] : 'h2';
216
+
217
+ // sanitize inputs
218
+ $atts['terms'] = sanitize_text_field( $atts['terms'] );
219
+ $atts['pids'] = sanitize_text_field( $atts['pids'] );
220
+ $atts['post__in'] = sanitize_text_field( $atts['post__in'] );
221
+ $atts['date_format'] = sanitize_text_field( $atts['date_format'] );
222
+
223
+ return $atts;
224
+ }
225
+
226
+ public static function post_slider_attr( $atts, $empty_is_false = false ) {
227
+ // sanitize bools
228
+ $bools = array( 'ignore_sticky_posts', 'show_meta_category', 'show_title', 'show_content', 'slider_auto', 'nopaging' );
229
+ foreach ( $bools as $key ) {
230
+ if ( isset( $atts[ $key ] ) ) {
231
+ if ( "no" == $key ) {
232
+ $atts[ $key ] = 0;
233
+ }
234
+ else {
235
+ $atts[ $key ] = (bool) $atts[ $key ];
236
+ $atts[ $key ] = $atts[ $key ] ? 1 : 0;
237
+ }
238
+ }
239
+ else if ( $empty_is_false ) {
240
+ $atts[ $key ] = 0;
241
+ }
242
+ }
243
+
244
+ $atts['nopaging'] = (bool) $atts['nopaging'];
245
+
246
+ // sanitize ints
247
+ $ints = array( 'p', 'posts_per_page', 'heading_size', 'mobile_heading_size', 'excerpt_length', 'desktop_height', 'laptop_height', 'mobile_height', 'slider_pause' );
248
+ foreach ( $ints as $key ) {
249
+ if ( isset( $atts[ $key ] ) ) {
250
+ $atts[ $key ] = (int) $atts[ $key ];
251
+ }
252
+ }
253
+ $atts['slider_pause'] = abs( $atts['slider_pause'] );
254
+
255
+ // sanitize limit
256
+ if ( $atts['posts_per_page'] < 0 ) {
257
+ $atts['posts_per_page'] = -1;
258
+ $atts['nopaging'] = true;
259
+ }
260
+
261
+ // sanitize dropdown
262
+ $valid_layouts = array( 'bxslider' );
263
+ if ( ! in_array( $atts['layout'], $valid_layouts ) ) {
264
+ $atts['layout'] = 'bxslider';
265
+ }
266
+
267
+ $valid_templates = array( 'slider1', 'slider2' );
268
+ if ( ! in_array( $atts['template'], $valid_templates ) ) {
269
+ $atts['template'] = 'slider1';
270
+ }
271
+
272
+ $valid_slider_modes = array( 'fade', 'vertical', 'horizontal' );
273
+ if ( ! in_array( $atts['slider_mode'], $valid_slider_modes ) ) {
274
+ $atts['slider_mode'] = 'fade';
275
+ }
276
+
277
+ $valid_orders = array( 'ASC', 'DESC' );
278
+ $atts['order'] = strtoupper( $atts['order'] );
279
+ if ( ! in_array( $atts['order'], $valid_orders ) ) {
280
+ $atts['order'] = 'DESC';
281
+ }
282
+
283
+ $atts['heading_type'] = strtolower( $atts['heading_type'] );
284
+ $valid_headings = array( 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' );
285
+ $atts['heading_type'] = in_array( $atts['heading_type'], $valid_headings ) ? $atts['heading_type'] : 'h2';
286
+
287
+ // sanitize inputs
288
+ $atts['button_class'] = sanitize_text_field( $atts['button_class'] );
289
+ $atts['button_class'] = empty( $atts['button_class'] ) ? 'wc-shortcodes-post-slide-button' : $atts['button_class'];
290
+ $atts['terms'] = sanitize_text_field( $atts['terms'] );
291
+ $atts['pids'] = sanitize_text_field( $atts['pids'] );
292
+ $atts['post__in'] = sanitize_text_field( $atts['post__in'] );
293
+
294
+ return $atts;
295
  }
296
  }
public/class-vars.php CHANGED
@@ -8,7 +8,7 @@ class WPC_Shortcodes_Vars {
8
  *
9
  * @var string
10
  */
11
- const VERSION = '3.2';
12
  const DB_VERSION = '1.0';
13
 
14
  /**
@@ -32,6 +32,7 @@ class WPC_Shortcodes_Vars {
32
  protected static $social_icons;
33
  protected static $share_buttons;
34
  protected static $theme_support;
 
35
 
36
  public static function init_vars() {
37
  define( 'WC_SHORTCODES_IS_ACTIVATED', true );
@@ -125,5 +126,87 @@ class WPC_Shortcodes_Vars {
125
  'print_share_font_icon' => 'fa-print',
126
  'print_share_button' => WC_SHORTCODES_PLUGIN_URL . 'public/assets/img/print.png',
127
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  }
129
  }
8
  *
9
  * @var string
10
  */
11
+ const VERSION = '3.3';
12
  const DB_VERSION = '1.0';
13
 
14
  /**
32
  protected static $social_icons;
33
  protected static $share_buttons;
34
  protected static $theme_support;
35
+ public static $attr;
36
 
37
  public static function init_vars() {
38
  define( 'WC_SHORTCODES_IS_ACTIVATED', true );
126
  'print_share_font_icon' => 'fa-print',
127
  'print_share_button' => WC_SHORTCODES_PLUGIN_URL . 'public/assets/img/print.png',
128
  );
129
+
130
+ // Shortcode Options
131
+ self::$attr = (object) array();
132
+ self::$attr->posts = array(
133
+ 'author' => '', //use author id
134
+ 'author_name' => '', //use 'user_nicename' (NOT name).
135
+ 'pids' => '', //use post id.
136
+ 'p' => '', //use post id.
137
+ 'post__in' => false, //use post ids
138
+ 'order' => 'DESC', // DESC, ASC
139
+ 'orderby' => 'date',
140
+ 'post_status' => 'publish',
141
+ 'post_type' => 'post', // post, page, wc_portfolio_item, etc
142
+ 'posts_per_page' => 10, //number of post to show per page
143
+ 'nopaging' => false, //show all posts or use pagination. Default value is 'false', use paging.
144
+ 'paged' => 1, // number of page. Show the posts that would normally show up just on page X when using the "Older Entries" link.
145
+ 'ignore_sticky_posts' => 0,
146
+
147
+ 'taxonomy' => '', // category, post_tag, wc_portfolio_tag, etc
148
+ 'field' => 'slug', // slug or id
149
+ 'terms' => '', // taxonomy terms.
150
+
151
+ 'show_title' => 1, // show heading?
152
+ 'show_meta_all' => 1, // show all meta info?
153
+ 'show_meta_author' => 1, // show author?
154
+ 'show_meta_date' => 1, // show date?
155
+ 'show_meta_comments' => 1, // show comments?
156
+ 'show_thumbnail' => 1, // show thumbnail?
157
+ 'show_content' => 1, // show main content?
158
+ 'show_paging' => 1, // show pagination navigation?
159
+
160
+ 'size' => 'large', // default thumbnail size
161
+
162
+ 'filtering' => 1, // insert isotope filter navigation
163
+ 'columns' => '3', // default number of isotope columns
164
+ 'gutter_space' => '20', // gutter width percentage relative to parent element width
165
+ 'heading_type' => 'h2', // heading tag for title
166
+ 'layout' => 'masonry', // blog layout
167
+ 'template' => 'box',
168
+ 'excerpt_length' => '30',
169
+ 'date_format' => 'M j, Y',
170
+ );
171
+ self::$attr->post_slider = array(
172
+ 'author' => '', //use author id
173
+ 'author_name' => '', //use 'user_nicename' (NOT name).
174
+ 'pids' => '', //use post id.
175
+ 'p' => '', //use post id.
176
+ 'post__in' => '', //use post ids
177
+ 'order' => 'DESC', // DESC, ASC
178
+ 'orderby' => 'date',
179
+ 'post_status' => 'publish',
180
+ 'post_type' => 'post', // post, page, wc_portfolio_item, etc
181
+ 'posts_per_page' => 10, //number of post to show per page
182
+ 'nopaging' => false, //show all posts or use pagination. Default value is 'false', use paging.
183
+ 'ignore_sticky_posts' => 1,
184
+
185
+ 'taxonomy' => '', // category, post_tag, wc_portfolio_tag, etc
186
+ 'field' => 'slug', // slug or id
187
+ 'terms' => '', // taxonomy terms.
188
+
189
+ 'show_meta_category' => 1, // show heading?
190
+ 'show_title' => 1, // show heading?
191
+ 'show_content' => 1, // show main content?
192
+ 'readmore' => 'Continue Reading', // show main content?
193
+ 'button_class' => 'button secondary-button', // show main content?
194
+
195
+ 'size' => 'full', // default thumbnail size
196
+
197
+ 'heading_type' => 'h2', // heading tag for title
198
+ 'heading_size' => 30,
199
+ 'mobile_heading_size' => 24,
200
+ 'layout' => 'bxslider', // blog layout
201
+ 'template' => 'slider2',
202
+ 'excerpt_length' => 55,
203
+ 'desktop_height' => 600,
204
+ 'laptop_height' => 500,
205
+ 'mobile_height' => 350,
206
+
207
+ 'slider_mode' => 'fade',
208
+ 'slider_pause' => 4000,
209
+ 'slider_auto' => 0,
210
+ );
211
  }
212
  }
public/class-widgets.php CHANGED
@@ -34,5 +34,6 @@ class WPC_Shortcodes_Widgets extends WPC_Shortcodes_Vars {
34
  public function register_widgets() {
35
  register_widget( 'WC_Shortcodes_Social_Icons_Widget' );
36
  register_widget( 'WC_Shortcodes_Post_Slider_Widget' );
 
37
  }
38
  }
34
  public function register_widgets() {
35
  register_widget( 'WC_Shortcodes_Social_Icons_Widget' );
36
  register_widget( 'WC_Shortcodes_Post_Slider_Widget' );
37
+ // register_widget( 'WC_Shortcodes_Posts_Widget' );
38
  }
39
  }
public/templates/borderless/content-aside.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
- <?php if ( $display['thumbnail'] && has_post_thumbnail() && ! post_password_required() ) : ?>
5
  <div class="wc-shortcodes-entry-thumbnail">
6
  <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( $display['size'] ); ?></a>
7
  </div>
8
  <?php endif; ?>
9
 
10
- <?php if ( $display['content'] ) : ?>
11
  <?php wc_shortcodes_the_content(); ?>
12
  <?php endif; ?>
13
 
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
+ <?php if ( $display['show_thumbnail'] && has_post_thumbnail() && ! post_password_required() ) : ?>
5
  <div class="wc-shortcodes-entry-thumbnail">
6
  <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( $display['size'] ); ?></a>
7
  </div>
8
  <?php endif; ?>
9
 
10
+ <?php if ( $display['show_content'] ) : ?>
11
  <?php wc_shortcodes_the_content(); ?>
12
  <?php endif; ?>
13
 
public/templates/borderless/content-audio.php CHANGED
@@ -5,13 +5,13 @@
5
  <?php wc_shortcodes_the_media_content(); ?>
6
  </div><!-- .entry-summary -->
7
 
8
- <?php if ( $display['title'] ) : ?>
9
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
10
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
11
  </<?php echo $display['heading_type']; ?>>
12
  <?php endif; ?>
13
 
14
- <?php if ( $display['content'] ) : ?>
15
  <?php wc_shortcodes_the_excerpt(); ?>
16
  <?php endif; ?>
17
 
5
  <?php wc_shortcodes_the_media_content(); ?>
6
  </div><!-- .entry-summary -->
7
 
8
+ <?php if ( $display['show_title'] ) : ?>
9
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
10
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
11
  </<?php echo $display['heading_type']; ?>>
12
  <?php endif; ?>
13
 
14
+ <?php if ( $display['show_content'] ) : ?>
15
  <?php wc_shortcodes_the_excerpt(); ?>
16
  <?php endif; ?>
17
 
public/templates/borderless/content-chat.php CHANGED
@@ -1,19 +1,19 @@
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
- <?php if ( $display['thumbnail'] && has_post_thumbnail() && ! post_password_required() ) : ?>
5
  <div class="wc-shortcodes-entry-thumbnail">
6
  <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( $display['size'] ); ?></a>
7
  </div>
8
  <?php endif; ?>
9
 
10
- <?php if ( $display['title'] ) : ?>
11
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
12
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
13
  </<?php echo $display['heading_type']; ?>>
14
  <?php endif; ?>
15
 
16
- <?php if ( $display['content'] ) : ?>
17
  <?php wc_shortcodes_the_excerpt(); ?>
18
  <?php endif; ?>
19
 
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
+ <?php if ( $display['show_thumbnail'] && has_post_thumbnail() && ! post_password_required() ) : ?>
5
  <div class="wc-shortcodes-entry-thumbnail">
6
  <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( $display['size'] ); ?></a>
7
  </div>
8
  <?php endif; ?>
9
 
10
+ <?php if ( $display['show_title'] ) : ?>
11
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
12
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
13
  </<?php echo $display['heading_type']; ?>>
14
  <?php endif; ?>
15
 
16
+ <?php if ( $display['show_content'] ) : ?>
17
  <?php wc_shortcodes_the_excerpt(); ?>
18
  <?php endif; ?>
19
 
public/templates/borderless/content-excerpt.php CHANGED
@@ -1,19 +1,19 @@
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
- <?php if ( $display['thumbnail'] && has_post_thumbnail() && ! post_password_required() ) : ?>
5
  <div class="wc-shortcodes-entry-thumbnail">
6
  <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( $display['size'] ); ?></a>
7
  </div>
8
  <?php endif; ?>
9
 
10
- <?php if ( $display['title'] ) : ?>
11
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
12
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
13
  </<?php echo $display['heading_type']; ?>>
14
  <?php endif; ?>
15
 
16
- <?php if ( $display['content'] ) : ?>
17
  <?php wc_shortcodes_the_excerpt(); ?>
18
  <?php endif; ?>
19
 
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
+ <?php if ( $display['show_thumbnail'] && has_post_thumbnail() && ! post_password_required() ) : ?>
5
  <div class="wc-shortcodes-entry-thumbnail">
6
  <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( $display['size'] ); ?></a>
7
  </div>
8
  <?php endif; ?>
9
 
10
+ <?php if ( $display['show_title'] ) : ?>
11
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
12
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
13
  </<?php echo $display['heading_type']; ?>>
14
  <?php endif; ?>
15
 
16
+ <?php if ( $display['show_content'] ) : ?>
17
  <?php wc_shortcodes_the_excerpt(); ?>
18
  <?php endif; ?>
19
 
public/templates/borderless/content-gallery.php CHANGED
@@ -15,13 +15,13 @@
15
  </div>
16
  <?php endif; ?>
17
 
18
- <?php if ( $display['title'] ) : ?>
19
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
20
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
21
  </<?php echo $display['heading_type']; ?>>
22
  <?php endif; ?>
23
 
24
- <?php if ( $display['content'] ) : ?>
25
  <?php wc_shortcodes_the_excerpt(); ?>
26
  <?php endif; ?>
27
 
15
  </div>
16
  <?php endif; ?>
17
 
18
+ <?php if ( $display['show_title'] ) : ?>
19
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
20
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
21
  </<?php echo $display['heading_type']; ?>>
22
  <?php endif; ?>
23
 
24
+ <?php if ( $display['show_content'] ) : ?>
25
  <?php wc_shortcodes_the_excerpt(); ?>
26
  <?php endif; ?>
27
 
public/templates/borderless/content-link.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
- <?php if ( $display['thumbnail'] && has_post_thumbnail() && ! post_password_required() ) : ?>
5
  <div class="wc-shortcodes-entry-thumbnail">
6
  <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( $display['size'] ); ?></a>
7
  </div>
8
  <?php endif; ?>
9
 
10
- <?php if ( $display['title'] ) : ?>
11
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
12
  <?php
13
  $content = get_the_content();
@@ -18,7 +18,7 @@
18
  </<?php echo $display['heading_type']; ?>>
19
  <?php endif; ?>
20
 
21
- <?php if ( $display['content'] ) : ?>
22
  <?php wc_shortcodes_the_content(); ?>
23
  <?php endif; ?>
24
 
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
+ <?php if ( $display['show_thumbnail'] && has_post_thumbnail() && ! post_password_required() ) : ?>
5
  <div class="wc-shortcodes-entry-thumbnail">
6
  <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( $display['size'] ); ?></a>
7
  </div>
8
  <?php endif; ?>
9
 
10
+ <?php if ( $display['show_title'] ) : ?>
11
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
12
  <?php
13
  $content = get_the_content();
18
  </<?php echo $display['heading_type']; ?>>
19
  <?php endif; ?>
20
 
21
+ <?php if ( $display['show_content'] ) : ?>
22
  <?php wc_shortcodes_the_content(); ?>
23
  <?php endif; ?>
24
 
public/templates/borderless/content-quote.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
- <?php if ( $display['content'] ) : ?>
5
  <div class="wc-shortcodes-entry-quote">
6
  <?php wc_shortcodes_the_content(); ?>
7
  </div><!-- .entry-summary -->
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
+ <?php if ( $display['show_content'] ) : ?>
5
  <div class="wc-shortcodes-entry-quote">
6
  <?php wc_shortcodes_the_content(); ?>
7
  </div><!-- .entry-summary -->
public/templates/borderless/content-video.php CHANGED
@@ -5,7 +5,7 @@
5
  <?php wc_shortcodes_the_media_content(); ?>
6
  </div><!-- .entry-summary -->
7
 
8
- <?php if ( $display['title'] ) : ?>
9
  <div class="wc-shortcodes-entry-header">
10
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
11
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
@@ -13,7 +13,7 @@
13
  </div><!-- .entry-header -->
14
  <?php endif; ?>
15
 
16
- <?php if ( $display['content'] ) : ?>
17
  <?php wc_shortcodes_the_excerpt(); ?>
18
  <?php endif; ?>
19
 
5
  <?php wc_shortcodes_the_media_content(); ?>
6
  </div><!-- .entry-summary -->
7
 
8
+ <?php if ( $display['show_title'] ) : ?>
9
  <div class="wc-shortcodes-entry-header">
10
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
11
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
13
  </div><!-- .entry-header -->
14
  <?php endif; ?>
15
 
16
+ <?php if ( $display['show_content'] ) : ?>
17
  <?php wc_shortcodes_the_excerpt(); ?>
18
  <?php endif; ?>
19
 
public/templates/borderless/content.php CHANGED
@@ -1,19 +1,19 @@
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
- <?php if ( $display['thumbnail'] && has_post_thumbnail() && ! post_password_required() ) : ?>
5
  <div class="wc-shortcodes-entry-thumbnail">
6
  <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( $display['size'] ); ?></a>
7
  </div>
8
  <?php endif; ?>
9
 
10
- <?php if ( $display['title'] ) : ?>
11
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
12
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
13
  </<?php echo $display['heading_type']; ?>>
14
  <?php endif; ?>
15
 
16
- <?php if ( $display['content'] ) : ?>
17
  <?php wc_shortcodes_the_excerpt(); ?>
18
  <?php endif; ?>
19
 
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
+ <?php if ( $display['show_thumbnail'] && has_post_thumbnail() && ! post_password_required() ) : ?>
5
  <div class="wc-shortcodes-entry-thumbnail">
6
  <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( $display['size'] ); ?></a>
7
  </div>
8
  <?php endif; ?>
9
 
10
+ <?php if ( $display['show_title'] ) : ?>
11
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
12
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
13
  </<?php echo $display['heading_type']; ?>>
14
  <?php endif; ?>
15
 
16
+ <?php if ( $display['show_content'] ) : ?>
17
  <?php wc_shortcodes_the_excerpt(); ?>
18
  <?php endif; ?>
19
 
public/templates/borderless/entry-meta.php CHANGED
@@ -1,6 +1,6 @@
1
- <?php if ( $display['meta_all'] ) : ?>
2
  <div class="wc-shortcodes-footer-entry-meta wc-shortcodes-clearfix">
3
- <?php if ( $display['meta_comments'] ) : ?>
4
  <?php if ( comments_open() ) : ?>
5
  <span class="wc-shortcodes-comments-link">
6
  <?php comments_popup_link( '<span class="wc-shortcodes-leave-reply">' . __( '0', 'wordpresscanvas' ) . '</span>', __( '1', 'wordpresscanvas' ), __( '%', 'wordpresscanvas' ) ); ?>
@@ -11,7 +11,7 @@
11
  <?php
12
  $meta = array();
13
  // Post author
14
- if ( $display['meta_author'] ) {
15
  $meta[] = sprintf( '<span class="wc-shortcodes-author"><span class="wc-shortcodes-by">' . __( 'By', 'wc_shortcodes' ) . '</span> <a class="wc-shortcodes-url" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
16
  esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
17
  get_the_author(),
@@ -21,7 +21,7 @@
21
  ?>
22
 
23
  <?php
24
- if ( $display['meta_date'] && ! has_post_format( 'link' ) ) {
25
  $meta[] = sprintf( '<span class="wc-shortcodes-date"><a href="%1$s" title="%2$s" rel="bookmark"><time class="wc-shortcodes-entry-date" datetime="%3$s">%4$s</time></a></span>',
26
  esc_url( get_permalink() ),
27
  esc_attr( sprintf( __( 'Permalink to %s', 'wordpresscanvas' ), the_title_attribute( 'echo=0' ) ) ),
1
+ <?php if ( $display['show_meta_all'] ) : ?>
2
  <div class="wc-shortcodes-footer-entry-meta wc-shortcodes-clearfix">
3
+ <?php if ( $display['show_meta_comments'] ) : ?>
4
  <?php if ( comments_open() ) : ?>
5
  <span class="wc-shortcodes-comments-link">
6
  <?php comments_popup_link( '<span class="wc-shortcodes-leave-reply">' . __( '0', 'wordpresscanvas' ) . '</span>', __( '1', 'wordpresscanvas' ), __( '%', 'wordpresscanvas' ) ); ?>
11
  <?php
12
  $meta = array();
13
  // Post author
14
+ if ( $display['show_meta_author'] ) {
15
  $meta[] = sprintf( '<span class="wc-shortcodes-author"><span class="wc-shortcodes-by">' . __( 'By', 'wc_shortcodes' ) . '</span> <a class="wc-shortcodes-url" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
16
  esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
17
  get_the_author(),
21
  ?>
22
 
23
  <?php
24
+ if ( $display['show_meta_date'] && ! has_post_format( 'link' ) ) {
25
  $meta[] = sprintf( '<span class="wc-shortcodes-date"><a href="%1$s" title="%2$s" rel="bookmark"><time class="wc-shortcodes-entry-date" datetime="%3$s">%4$s</time></a></span>',
26
  esc_url( get_permalink() ),
27
  esc_attr( sprintf( __( 'Permalink to %s', 'wordpresscanvas' ), the_title_attribute( 'echo=0' ) ) ),
public/templates/box/content-aside.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
- <?php if ( $display['thumbnail'] && has_post_thumbnail() && ! post_password_required() ) : ?>
5
  <div class="wc-shortcodes-entry-thumbnail">
6
  <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( $display['size'] ); ?></a>
7
  </div>
8
  <?php endif; ?>
9
 
10
  <div class="wc-shortcodes-post-content">
11
- <?php if ( $display['content'] ) : ?>
12
  <div class="wc-shortcodes-entry-summary">
13
  <?php wc_shortcodes_the_content(); ?>
14
  </div><!-- .entry-summary -->
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
+ <?php if ( $display['show_thumbnail'] && has_post_thumbnail() && ! post_password_required() ) : ?>
5
  <div class="wc-shortcodes-entry-thumbnail">
6
  <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( $display['size'] ); ?></a>
7
  </div>
8
  <?php endif; ?>
9
 
10
  <div class="wc-shortcodes-post-content">
11
+ <?php if ( $display['show_content'] ) : ?>
12
  <div class="wc-shortcodes-entry-summary">
13
  <?php wc_shortcodes_the_content(); ?>
14
  </div><!-- .entry-summary -->
public/templates/box/content-audio.php CHANGED
@@ -6,7 +6,7 @@
6
  </div><!-- .entry-summary -->
7
 
8
  <div class="wc-shortcodes-post-content">
9
- <?php if ( $display['title'] ) : ?>
10
  <div class="wc-shortcodes-entry-header">
11
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
12
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
@@ -14,7 +14,7 @@
14
  </div><!-- .entry-header -->
15
  <?php endif; ?>
16
 
17
- <?php if ( $display['content'] ) : ?>
18
  <div class="wc-shortcodes-entry-summary">
19
  <?php wc_shortcodes_the_excerpt(); ?>
20
  </div>
6
  </div><!-- .entry-summary -->
7
 
8
  <div class="wc-shortcodes-post-content">
9
+ <?php if ( $display['show_title'] ) : ?>
10
  <div class="wc-shortcodes-entry-header">
11
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
12
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
14
  </div><!-- .entry-header -->
15
  <?php endif; ?>
16
 
17
+ <?php if ( $display['show_content'] ) : ?>
18
  <div class="wc-shortcodes-entry-summary">
19
  <?php wc_shortcodes_the_excerpt(); ?>
20
  </div>
public/templates/box/content-chat.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
- <?php if ( $display['thumbnail'] && has_post_thumbnail() && ! post_password_required() ) : ?>
5
  <div class="wc-shortcodes-entry-thumbnail">
6
  <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( $display['size'] ); ?></a>
7
  </div>
8
  <?php endif; ?>
9
 
10
  <div class="wc-shortcodes-post-content">
11
- <?php if ( $display['title'] ) : ?>
12
  <div class="wc-shortcodes-entry-header">
13
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
14
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
@@ -16,7 +16,7 @@
16
  </div><!-- .entry-header -->
17
  <?php endif; ?>
18
 
19
- <?php if ( $display['content'] ) : ?>
20
  <div class="wc-shortcodes-entry-summary">
21
  <?php wc_shortcodes_the_excerpt(); ?>
22
  </div><!-- .entry-summary -->
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
+ <?php if ( $display['show_thumbnail'] && has_post_thumbnail() && ! post_password_required() ) : ?>
5
  <div class="wc-shortcodes-entry-thumbnail">
6
  <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( $display['size'] ); ?></a>
7
  </div>
8
  <?php endif; ?>
9
 
10
  <div class="wc-shortcodes-post-content">
11
+ <?php if ( $display['show_title'] ) : ?>
12
  <div class="wc-shortcodes-entry-header">
13
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
14
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
16
  </div><!-- .entry-header -->
17
  <?php endif; ?>
18
 
19
+ <?php if ( $display['show_content'] ) : ?>
20
  <div class="wc-shortcodes-entry-summary">
21
  <?php wc_shortcodes_the_excerpt(); ?>
22
  </div><!-- .entry-summary -->
public/templates/box/content-excerpt.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
- <?php if ( $display['thumbnail'] && has_post_thumbnail() && ! post_password_required() ) : ?>
5
  <div class="wc-shortcodes-entry-thumbnail">
6
  <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( $display['size'] ); ?></a>
7
  </div>
8
  <?php endif; ?>
9
 
10
  <div class="wc-shortcodes-post-content">
11
- <?php if ( $display['title'] ) : ?>
12
  <div class="wc-shortcodes-entry-header">
13
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
14
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
@@ -16,7 +16,7 @@
16
  </div><!-- .entry-header -->
17
  <?php endif; ?>
18
 
19
- <?php if ( $display['content'] ) : ?>
20
  <div class="wc-shortcodes-entry-summary">
21
  <?php wc_shortcodes_the_excerpt(); ?>
22
  </div><!-- .entry-summary -->
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
+ <?php if ( $display['show_thumbnail'] && has_post_thumbnail() && ! post_password_required() ) : ?>
5
  <div class="wc-shortcodes-entry-thumbnail">
6
  <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( $display['size'] ); ?></a>
7
  </div>
8
  <?php endif; ?>
9
 
10
  <div class="wc-shortcodes-post-content">
11
+ <?php if ( $display['show_title'] ) : ?>
12
  <div class="wc-shortcodes-entry-header">
13
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
14
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
16
  </div><!-- .entry-header -->
17
  <?php endif; ?>
18
 
19
+ <?php if ( $display['show_content'] ) : ?>
20
  <div class="wc-shortcodes-entry-summary">
21
  <?php wc_shortcodes_the_excerpt(); ?>
22
  </div><!-- .entry-summary -->
public/templates/box/content-gallery.php CHANGED
@@ -15,7 +15,7 @@
15
  <?php endif; ?>
16
 
17
  <div class="wc-shortcodes-post-content">
18
- <?php if ( $display['title'] ) : ?>
19
  <div class="wc-shortcodes-entry-header">
20
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
21
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
@@ -23,7 +23,7 @@
23
  </div><!-- .entry-header -->
24
  <?php endif; ?>
25
 
26
- <?php if ( $display['content'] ) : ?>
27
  <div class="wc-shortcodes-entry-summary">
28
  <?php wc_shortcodes_the_excerpt(); ?>
29
  </div><!-- .entry-summary -->
15
  <?php endif; ?>
16
 
17
  <div class="wc-shortcodes-post-content">
18
+ <?php if ( $display['show_title'] ) : ?>
19
  <div class="wc-shortcodes-entry-header">
20
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
21
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
23
  </div><!-- .entry-header -->
24
  <?php endif; ?>
25
 
26
+ <?php if ( $display['show_content'] ) : ?>
27
  <div class="wc-shortcodes-entry-summary">
28
  <?php wc_shortcodes_the_excerpt(); ?>
29
  </div><!-- .entry-summary -->
public/templates/box/content-link.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
- <?php if ( $display['thumbnail'] && has_post_thumbnail() && ! post_password_required() ) : ?>
5
  <div class="wc-shortcodes-entry-thumbnail">
6
  <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( $display['size'] ); ?></a>
7
  </div>
8
  <?php endif; ?>
9
 
10
  <div class="wc-shortcodes-post-content">
11
- <?php if ( $display['title'] ) : ?>
12
  <div class="wc-shortcodes-entry-header">
13
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
14
  <?php
@@ -21,7 +21,7 @@
21
  </div><!-- .entry-header -->
22
  <?php endif; ?>
23
 
24
- <?php if ( $display['content'] ) : ?>
25
  <div class="wc-shortcodes-entry-summary">
26
  <?php wc_shortcodes_the_content(); ?>
27
  </div><!-- .entry-summary -->
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
+ <?php if ( $display['show_thumbnail'] && has_post_thumbnail() && ! post_password_required() ) : ?>
5
  <div class="wc-shortcodes-entry-thumbnail">
6
  <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( $display['size'] ); ?></a>
7
  </div>
8
  <?php endif; ?>
9
 
10
  <div class="wc-shortcodes-post-content">
11
+ <?php if ( $display['show_title'] ) : ?>
12
  <div class="wc-shortcodes-entry-header">
13
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
14
  <?php
21
  </div><!-- .entry-header -->
22
  <?php endif; ?>
23
 
24
+ <?php if ( $display['show_content'] ) : ?>
25
  <div class="wc-shortcodes-entry-summary">
26
  <?php wc_shortcodes_the_content(); ?>
27
  </div><!-- .entry-summary -->
public/templates/box/content-quote.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
- <?php if ( $display['content'] ) : ?>
5
  <div class="wc-shortcodes-entry-quote">
6
  <?php wc_shortcodes_the_content(); ?>
7
  </div><!-- .entry-summary -->
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
+ <?php if ( $display['show_content'] ) : ?>
5
  <div class="wc-shortcodes-entry-quote">
6
  <?php wc_shortcodes_the_content(); ?>
7
  </div><!-- .entry-summary -->
public/templates/box/content-video.php CHANGED
@@ -6,7 +6,7 @@
6
  </div><!-- .entry-summary -->
7
 
8
  <div class="wc-shortcodes-post-content">
9
- <?php if ( $display['title'] ) : ?>
10
  <div class="wc-shortcodes-entry-header">
11
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
12
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
@@ -14,7 +14,7 @@
14
  </div><!-- .entry-header -->
15
  <?php endif; ?>
16
 
17
- <?php if ( $display['content'] ) : ?>
18
  <div class="wc-shortcodes-entry-summary">
19
  <?php wc_shortcodes_the_excerpt(); ?>
20
  </div>
6
  </div><!-- .entry-summary -->
7
 
8
  <div class="wc-shortcodes-post-content">
9
+ <?php if ( $display['show_title'] ) : ?>
10
  <div class="wc-shortcodes-entry-header">
11
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
12
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
14
  </div><!-- .entry-header -->
15
  <?php endif; ?>
16
 
17
+ <?php if ( $display['show_content'] ) : ?>
18
  <div class="wc-shortcodes-entry-summary">
19
  <?php wc_shortcodes_the_excerpt(); ?>
20
  </div>
public/templates/box/content.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
- <?php if ( $display['thumbnail'] && has_post_thumbnail() && ! post_password_required() ) : ?>
5
  <div class="wc-shortcodes-entry-thumbnail">
6
  <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( $display['size'] ); ?></a>
7
  </div>
8
  <?php endif; ?>
9
 
10
  <div class="wc-shortcodes-post-content">
11
- <?php if ( $display['title'] ) : ?>
12
  <div class="wc-shortcodes-entry-header">
13
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
14
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
@@ -16,7 +16,7 @@
16
  </div><!-- .entry-header -->
17
  <?php endif; ?>
18
 
19
- <?php if ( $display['content'] ) : ?>
20
  <div class="wc-shortcodes-entry-summary">
21
  <?php wc_shortcodes_the_excerpt(); ?>
22
  </div><!-- .entry-summary -->
1
  <?php $classes[] = 'wc-shortcodes-post-box'; ?>
2
  <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
3
  <div class="wc-shortcodes-post-border">
4
+ <?php if ( $display['show_thumbnail'] && has_post_thumbnail() && ! post_password_required() ) : ?>
5
  <div class="wc-shortcodes-entry-thumbnail">
6
  <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( $display['size'] ); ?></a>
7
  </div>
8
  <?php endif; ?>
9
 
10
  <div class="wc-shortcodes-post-content">
11
+ <?php if ( $display['show_title'] ) : ?>
12
  <div class="wc-shortcodes-entry-header">
13
  <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
14
  <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
16
  </div><!-- .entry-header -->
17
  <?php endif; ?>
18
 
19
+ <?php if ( $display['show_content'] ) : ?>
20
  <div class="wc-shortcodes-entry-summary">
21
  <?php wc_shortcodes_the_excerpt(); ?>
22
  </div><!-- .entry-summary -->
public/templates/box/entry-meta.php CHANGED
@@ -1,7 +1,7 @@
1
- <?php if ( $display['meta_all'] ) : ?>
2
  <div class="wc-shortcodes-footer-entry-meta wc-shortcodes-clearfix">
3
  <div class="wc-shortcodes-entry-meta-inner wc-shortcodes-clearfix">
4
- <?php if ( $display['meta_comments'] ) : ?>
5
  <?php if ( comments_open() ) : ?>
6
  <span class="wc-shortcodes-comments-link">
7
  <?php comments_popup_link( '<span class="wc-shortcodes-leave-reply">' . __( '0', 'wordpresscanvas' ) . '</span>', __( '1', 'wordpresscanvas' ), __( '%', 'wordpresscanvas' ) ); ?>
@@ -12,7 +12,7 @@
12
  <?php
13
  $meta = array();
14
  // Post author
15
- if ( $display['meta_author'] ) {
16
  $meta[] = sprintf( '<span class="wc-shortcodes-author"><span class="wc-shortcodes-by">' . __( 'By', 'wc_shortcodes' ) . '</span> <a class="wc-shortcodes-url" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
17
  esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
18
  get_the_author(),
@@ -22,7 +22,7 @@
22
  ?>
23
 
24
  <?php
25
- if ( $display['meta_date'] && ! has_post_format( 'link' ) ) {
26
  $meta[] = sprintf( '<span class="wc-shortcodes-date"><a href="%1$s" title="%2$s" rel="bookmark"><time class="wc-shortcodes-entry-date" datetime="%3$s">%4$s</time></a></span>',
27
  esc_url( get_permalink() ),
28
  esc_attr( sprintf( __( 'Permalink to %s', 'wordpresscanvas' ), the_title_attribute( 'echo=0' ) ) ),
1
+ <?php if ( $display['show_meta_all'] ) : ?>
2
  <div class="wc-shortcodes-footer-entry-meta wc-shortcodes-clearfix">
3
  <div class="wc-shortcodes-entry-meta-inner wc-shortcodes-clearfix">
4
+ <?php if ( $display['show_meta_comments'] ) : ?>
5
  <?php if ( comments_open() ) : ?>
6
  <span class="wc-shortcodes-comments-link">
7
  <?php comments_popup_link( '<span class="wc-shortcodes-leave-reply">' . __( '0', 'wordpresscanvas' ) . '</span>', __( '1', 'wordpresscanvas' ), __( '%', 'wordpresscanvas' ) ); ?>
12
  <?php
13
  $meta = array();
14
  // Post author
15
+ if ( $display['show_meta_author'] ) {
16
  $meta[] = sprintf( '<span class="wc-shortcodes-author"><span class="wc-shortcodes-by">' . __( 'By', 'wc_shortcodes' ) . '</span> <a class="wc-shortcodes-url" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
17
  esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
18
  get_the_author(),
22
  ?>
23
 
24
  <?php
25
+ if ( $display['show_meta_date'] && ! has_post_format( 'link' ) ) {
26
  $meta[] = sprintf( '<span class="wc-shortcodes-date"><a href="%1$s" title="%2$s" rel="bookmark"><time class="wc-shortcodes-entry-date" datetime="%3$s">%4$s</time></a></span>',
27
  esc_url( get_permalink() ),
28
  esc_attr( sprintf( __( 'Permalink to %s', 'wordpresscanvas' ), the_title_attribute( 'echo=0' ) ) ),
public/widgets/widget-post-slider.php CHANGED
@@ -32,65 +32,20 @@ class WC_Shortcodes_Post_Slider_Widget extends WP_Widget {
32
  }
33
 
34
  function update( $new_instance, $old_instance ) {
35
- $instance['pids'] = $new_instance['pids'];
36
- $instance['order'] = $new_instance['order'];
37
- $instance['orderby'] = $new_instance['orderby'];
38
- $instance['post_type'] = $new_instance['post_type'];
39
- $instance['posts_per_page'] = (int) $new_instance['posts_per_page'];
40
- $instance['ignore_sticky_posts'] = (int) $new_instance['ignore_sticky_posts'];
41
- $instance['taxonomy'] = $new_instance['taxonomy'];
42
- $instance['terms'] = $new_instance['terms'];
43
- $instance['show_meta_category'] = (int) $new_instance['show_meta_category'];
44
- $instance['show_title'] = (int) $new_instance['show_title'];
45
- $instance['show_content'] = (int) $new_instance['show_content'];
46
- $instance['readmore'] = $new_instance['readmore'];
47
- $instance['button_class'] = strip_tags( stripslashes( $new_instance['button_class'] ) );
48
- $instance['size'] = $new_instance['size'];
49
- $instance['heading_type'] = $new_instance['heading_type'];
50
- $instance['heading_size'] = (int) $new_instance['heading_size'];
51
- $instance['mobile_heading_size'] = (int) $new_instance['mobile_heading_size'];
52
- $instance['excerpt_length'] = (int) $new_instance['excerpt_length'];
53
- $instance['desktop_height'] = (int) $new_instance['desktop_height'];
54
- $instance['laptop_height'] = (int) $new_instance['laptop_height'];
55
- $instance['mobile_height'] = (int) $new_instance['mobile_height'];
56
- $instance['template'] = $new_instance['template'];
57
- $instance['slider_mode'] = $new_instance['slider_mode'];
58
- $instance['slider_pause'] = (int) $new_instance['slider_pause'];
59
- $instance['slider_auto'] = (int) $new_instance['slider_auto'];
60
 
61
  return $instance;
62
  }
63
 
64
  function form( $instance ) {
65
- global $wc_shortcodes_widget_ops;
66
-
67
- $pids = isset( $instance['pids'] ) ? $instance['pids'] : '';
68
- $order = isset( $instance['order'] ) ? $instance['order'] : 'DESC';
69
- $orderby = isset( $instance['orderby'] ) ? $instance['orderby'] : 'date';
70
- $post_type = isset( $instance['post_type'] ) ? $instance['post_type'] : 'post';
71
- $posts_per_page = isset( $instance['posts_per_page'] ) ? $instance['posts_per_page'] : 10;
72
- $ignore_sticky_posts = isset( $instance['ignore_sticky_posts'] ) ? $instance['ignore_sticky_posts'] : 1;
73
- $taxonomy = isset( $instance['taxonomy'] ) ? $instance['taxonomy'] : '';
74
- $terms = isset( $instance['terms'] ) ? $instance['terms'] : '';
75
- $show_meta_category = isset( $instance['show_meta_category'] ) ? $instance['show_meta_category'] : 0;
76
- $show_title = isset( $instance['show_title'] ) ? $instance['show_title'] : 1;
77
- $show_content = isset( $instance['show_content'] ) ? $instance['show_content'] : 1;
78
- $readmore = isset( $instance['readmore'] ) ? $instance['readmore'] : 'Coninue Reading';
79
- $button_class = isset( $instance['button_class'] ) ? $instance['button_class'] : 'button secondary-button';
80
- $size = isset( $instance['size'] ) ? $instance['size'] : 'full';
81
- $heading_type = isset( $instance['heading_type'] ) ? $instance['heading_type'] : 'h2';
82
- $heading_size = isset( $instance['heading_size'] ) ? $instance['heading_size'] : 30;
83
- $mobile_heading_size = isset( $instance['mobile_heading_size'] ) ? $instance['mobile_heading_size'] : 24;
84
- $excerpt_length = isset( $instance['excerpt_length'] ) ? $instance['excerpt_length'] : 30;
85
- $desktop_height = isset( $instance['desktop_height'] ) ? $instance['desktop_height'] : 600;
86
- $instance['desktop_height'] = '600';
87
- $laptop_height = isset( $instance['laptop_height'] ) ? $instance['laptop_height'] : 500;
88
- $mobile_height = isset( $instance['mobile_height'] ) ? $instance['mobile_height'] : 350;
89
- $template = isset( $instance['template'] ) ? $instance['template'] : 'slider2';
90
- $slider_mode = isset( $instance['slider_mode'] ) ? $instance['slider_mode'] : 'fade';
91
- $slider_pause = isset( $instance['slider_pause'] ) ? $instance['slider_pause'] : 4000;
92
- $slider_auto = isset( $instance['slider_auto'] ) ? $instance['slider_auto'] : 0;
93
 
 
 
 
94
  $args = array(
95
  'public' => true,
96
  );
@@ -102,17 +57,17 @@ class WC_Shortcodes_Post_Slider_Widget extends WP_Widget {
102
  unset( $post_types['attachment'] );
103
  ?>
104
 
105
- <div id="wc-shortcodes-post-slider-widget-<?php echo $this->number; ?>" class="wc-shortcodes-post-slider-widget wpc-ui-theme-override">
106
  <h3>Select Posts</h3>
107
  <div>
108
  <p>
109
  <label for="<?php echo $this->get_field_id('pids'); ?>"><?php _e('Post IDs:') ?></label>
110
- <input type="text" class="widefat wc-shortcodes-widget-autocomplete-select" id="<?php echo $this->get_field_id('pids'); ?>" data-autocomplete-type="multi" data-autocomplete-lookup="post" name="<?php echo $this->get_field_name('pids'); ?>" value="<?php echo $pids; ?>" />
111
  <span class="wcs-description">Leave blank to display all posts.</span>
112
  </p>
113
  <p>
114
  <label for="<?php echo $this->get_field_id('order'); ?>"><?php _e('Order:'); ?></label>
115
- <select id="<?php echo $this->get_field_id('order'); ?>" name="<?php echo $this->get_field_name('order'); ?>">
116
  <?php
117
  $options = array(
118
  'DESC' => 'DESC',
@@ -120,13 +75,13 @@ class WC_Shortcodes_Post_Slider_Widget extends WP_Widget {
120
  );
121
  ?>
122
  <?php foreach ( $options as $key => $value ) : ?>
123
- <option value="<?php echo $key; ?>"<?php selected( $order, $key ); ?>><?php echo $value; ?></option>';
124
  <?php endforeach; ?>
125
  </select>
126
  </p>
127
  <p>
128
  <label for="<?php echo $this->get_field_id('orderby'); ?>"><?php _e('Order By:'); ?></label>
129
- <select id="<?php echo $this->get_field_id('orderby'); ?>" name="<?php echo $this->get_field_name('orderby'); ?>">
130
  <?php
131
  $options = array(
132
  'none' => 'No Order',
@@ -145,27 +100,27 @@ class WC_Shortcodes_Post_Slider_Widget extends WP_Widget {
145
  );
146
  ?>
147
  <?php foreach ( $options as $key => $value ) : ?>
148
- <option value="<?php echo $key; ?>"<?php selected( $orderby, $key ); ?>><?php echo $value; ?></option>';
149
  <?php endforeach; ?>
150
  </select>
151
  </p>
152
  <p>
153
  <label for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:'); ?></label>
154
- <select id="<?php echo $this->get_field_id('post_type'); ?>" class="wc-shortcodes-widget-post-type-selector" name="<?php echo $this->get_field_name('post_type'); ?>">
155
  <?php foreach ( $post_types as $key => $value ) : ?>
156
- <option value="<?php echo $key; ?>"<?php selected( $post_type, $key ); ?>><?php echo $value; ?></option>';
157
  <?php endforeach; ?>
158
  </select>
159
  </p>
160
  <p>
161
  <label for="<?php echo $this->get_field_id('taxonomy'); ?>"><?php _e('Taxonomy:'); ?></label>
162
- <select id="<?php echo $this->get_field_id('taxonomy'); ?>" class="wc-shortcodes-widget-taxonomy-selector" name="<?php echo $this->get_field_name('taxonomy'); ?>">
163
- <option value=""<?php selected( $taxonomy, "" ); ?>>No Taxonomy</option>';
164
  <?php foreach ( $post_types as $post_type_name ) : ?>
165
  <?php $taxonomies = get_object_taxonomies( $post_type_name, 'names' ); ?>
166
  <?php if ( $taxonomies ) : ?>
167
  <?php foreach ( $taxonomies as $key ) : ?>
168
- <option value="<?php echo $key; ?>"<?php selected( $taxonomy, $key ); ?> data-post-type="<?php echo $post_type_name; ?>"><?php echo $key; ?></option>
169
  <?php endforeach; ?>
170
  <?php endif; ?>
171
  <?php endforeach; ?>
@@ -173,44 +128,44 @@ class WC_Shortcodes_Post_Slider_Widget extends WP_Widget {
173
  </p>
174
  <p>
175
  <label for="<?php echo $this->get_field_id('terms'); ?>"><?php _e('Terms:') ?></label>
176
- <input type="text" class="widefat wc-shortcodes-widget-autocomplete-select" id="<?php echo $this->get_field_id('terms'); ?>" data-autocomplete-type="multi" data-autocomplete-lookup="terms" name="<?php echo $this->get_field_name('terms'); ?>" value="<?php echo $terms; ?>" />
177
  <span class="wcs-description">Leave blank to display all terms.</span>
178
  </p>
179
  <p>
180
  <label for="<?php echo $this->get_field_id('posts_per_page'); ?>"><?php _e('Posts Per Page:') ?></label>
181
- <input type="text" class="widefat" id="<?php echo $this->get_field_id('posts_per_page'); ?>" name="<?php echo $this->get_field_name('posts_per_page'); ?>" value="<?php echo $posts_per_page; ?>" />
182
  <span class="wcs-description">Enter -1 for unlimited posts.</span>
183
  </p>
184
  <p>
185
- <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('ignore_sticky_posts'); ?>" name="<?php echo $this->get_field_name('ignore_sticky_posts'); ?>" value="1" <?php checked( $ignore_sticky_posts, 1 ); ?> />
186
  <label for="<?php echo $this->get_field_id('ignore_sticky_posts'); ?>"><?php _e('Ignore Sticky Posts') ?></label>
187
  </p>
188
  </div>
189
  <h3>Content</h3>
190
  <div>
191
  <p>
192
- <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('show_meta_category'); ?>" name="<?php echo $this->get_field_name('show_meta_category'); ?>" value="1" <?php checked( $show_meta_category, 1 ); ?> />
193
  <label for="<?php echo $this->get_field_id('show_meta_category'); ?>"><?php _e('Show Meta Category') ?></label>
194
  </p>
195
  <p>
196
- <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('show_title'); ?>" name="<?php echo $this->get_field_name('show_title'); ?>" value="1" <?php checked( $show_title, 1 ); ?> />
197
  <label for="<?php echo $this->get_field_id('show_title'); ?>"><?php _e('Show Title') ?></label>
198
  </p>
199
  <p>
200
- <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('show_content'); ?>" name="<?php echo $this->get_field_name('show_content'); ?>" value="1" <?php checked( $show_content, 1 ); ?> />
201
  <label for="<?php echo $this->get_field_id('show_content'); ?>"><?php _e('Show Content') ?></label>
202
  </p>
203
  <p>
204
  <label for="<?php echo $this->get_field_id('readmore'); ?>"><?php _e('Read More Text:') ?></label>
205
- <input type="text" class="widefat" id="<?php echo $this->get_field_id('readmore'); ?>" name="<?php echo $this->get_field_name('readmore'); ?>" value="<?php echo $readmore; ?>" />
206
  </p>
207
  <p>
208
  <label for="<?php echo $this->get_field_id('button_class'); ?>"><?php _e('Button Class:') ?></label>
209
- <input type="text" class="widefat" id="<?php echo $this->get_field_id('button_class'); ?>" name="<?php echo $this->get_field_name('button_class'); ?>" value="<?php echo $button_class; ?>" />
210
  </p>
211
  <p>
212
  <label for="<?php echo $this->get_field_id('size'); ?>"><?php _e('Image Size:'); ?></label>
213
- <select id="<?php echo $this->get_field_id('size'); ?>" name="<?php echo $this->get_field_name('size'); ?>">
214
  <?php
215
  $sizes = apply_filters( 'image_size_names_choose', array(
216
  'thumbnail' => __('Thumbnail'),
@@ -220,13 +175,13 @@ class WC_Shortcodes_Post_Slider_Widget extends WP_Widget {
220
  ));
221
  ?>
222
  <?php foreach ( $sizes as $key => $value ) : ?>
223
- <option value="<?php echo $key; ?>"<?php selected( $size, $key ); ?>><?php echo $value; ?></option>
224
  <?php endforeach; ?>
225
  </select>
226
  </p>
227
  <p>
228
  <label for="<?php echo $this->get_field_id('heading_type'); ?>"><?php _e('Heading Type:'); ?></label>
229
- <select id="<?php echo $this->get_field_id('heading_type'); ?>" name="<?php echo $this->get_field_name('heading_type'); ?>">
230
  <?php
231
  $options = array(
232
  'h1' => 'H1',
@@ -238,7 +193,7 @@ class WC_Shortcodes_Post_Slider_Widget extends WP_Widget {
238
  );
239
  ?>
240
  <?php foreach ( $options as $key => $value ) : ?>
241
- <option value="<?php echo $key; ?>"<?php selected( $heading_type, $key ); ?>><?php echo $value; ?></option>';
242
  <?php endforeach; ?>
243
  </select>
244
  </p>
@@ -247,7 +202,7 @@ class WC_Shortcodes_Post_Slider_Widget extends WP_Widget {
247
  <div>
248
  <p>
249
  <label for="<?php echo $this->get_field_id('template'); ?>"><?php _e('Template:'); ?></label>
250
- <select id="<?php echo $this->get_field_id('template'); ?>" name="<?php echo $this->get_field_name('template'); ?>">
251
  <?php
252
  $options = array(
253
  'slider1' => 'Slider 1',
@@ -255,40 +210,40 @@ class WC_Shortcodes_Post_Slider_Widget extends WP_Widget {
255
  );
256
  ?>
257
  <?php foreach ( $options as $key => $value ) : ?>
258
- <option value="<?php echo $key; ?>"<?php selected( $template, $key ); ?>><?php echo $value; ?></option>';
259
  <?php endforeach; ?>
260
  </select>
261
  </p>
262
  <p>
263
  <label for="<?php echo $this->get_field_id('heading_size'); ?>"><?php _e('Heading Size:') ?></label>
264
- <input type="text" class="widefat" id="<?php echo $this->get_field_id('heading_size'); ?>" name="<?php echo $this->get_field_name('heading_size'); ?>" value="<?php echo $heading_size; ?>" />
265
  </p>
266
  <p>
267
  <label for="<?php echo $this->get_field_id('mobile_heading_size'); ?>"><?php _e('Mobile Heading Size:') ?></label>
268
- <input type="text" class="widefat" id="<?php echo $this->get_field_id('mobile_heading_size'); ?>" name="<?php echo $this->get_field_name('mobile_heading_size'); ?>" value="<?php echo $mobile_heading_size; ?>" />
269
  </p>
270
  <p>
271
  <label for="<?php echo $this->get_field_id('excerpt_length'); ?>"><?php _e('Excerpt Length:') ?></label>
272
- <input type="text" class="widefat" id="<?php echo $this->get_field_id('excerpt_length'); ?>" name="<?php echo $this->get_field_name('excerpt_length'); ?>" value="<?php echo $excerpt_length; ?>" />
273
  </p>
274
  <p>
275
  <label for="<?php echo $this->get_field_id('desktop_height'); ?>"><?php _e('Desktop Height:') ?></label>
276
- <input type="text" class="widefat" id="<?php echo $this->get_field_id('desktop_height'); ?>" name="<?php echo $this->get_field_name('desktop_height'); ?>" value="<?php echo $desktop_height; ?>" />
277
  </p>
278
  <p>
279
  <label for="<?php echo $this->get_field_id('laptop_height'); ?>"><?php _e('Laptop Height:') ?></label>
280
- <input type="text" class="widefat" id="<?php echo $this->get_field_id('laptop_height'); ?>" name="<?php echo $this->get_field_name('laptop_height'); ?>" value="<?php echo $laptop_height; ?>" />
281
  </p>
282
  <p>
283
  <label for="<?php echo $this->get_field_id('mobile_height'); ?>"><?php _e('Mobile Height:') ?></label>
284
- <input type="text" class="widefat" id="<?php echo $this->get_field_id('mobile_height'); ?>" name="<?php echo $this->get_field_name('mobile_height'); ?>" value="<?php echo $mobile_height; ?>" />
285
  </p>
286
  </div>
287
  <h3>Slider Settings</h3>
288
  <div>
289
  <p>
290
  <label for="<?php echo $this->get_field_id('slider_mode'); ?>"><?php _e('Slider Mode:'); ?></label>
291
- <select id="<?php echo $this->get_field_id('slider_mode'); ?>" name="<?php echo $this->get_field_name('slider_mode'); ?>">
292
  <?php
293
  $options = array(
294
  'fade' => 'Fade',
@@ -297,17 +252,17 @@ class WC_Shortcodes_Post_Slider_Widget extends WP_Widget {
297
  );
298
  ?>
299
  <?php foreach ( $options as $key => $value ) : ?>
300
- <option value="<?php echo $key; ?>"<?php selected( $slider_mode, $key ); ?>><?php echo $value; ?></option>';
301
  <?php endforeach; ?>
302
  </select>
303
  </p>
304
  <p>
305
  <label for="<?php echo $this->get_field_id('slider_pause'); ?>"><?php _e('Slider Pause:') ?></label>
306
- <input type="text" class="widefat" id="<?php echo $this->get_field_id('slider_pause'); ?>" name="<?php echo $this->get_field_name('slider_pause'); ?>" value="<?php echo $slider_pause; ?>" />
307
  <span class="wcs-description">Enter number in milliseconds.</span>
308
  </p>
309
  <p>
310
- <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('slider_auto'); ?>" name="<?php echo $this->get_field_name('slider_auto'); ?>" value="1" <?php checked( $slider_auto, 1 ); ?> />
311
  <label for="<?php echo $this->get_field_id('slider_auto'); ?>"><?php _e('Enable Auto Transition') ?></label>
312
  </p>
313
  </div>
@@ -316,7 +271,7 @@ class WC_Shortcodes_Post_Slider_Widget extends WP_Widget {
316
  <script type="text/javascript">
317
  /* <![CDATA[ */
318
  jQuery(document).ready(function($){
319
- $('#wc-shortcodes-post-slider-widget-<?php echo $this->number; ?>').accordion({heightStyle: "content"}).wcPostSliderWidget();
320
  });
321
  /* ]]> */
322
  </script>
32
  }
33
 
34
  function update( $new_instance, $old_instance ) {
35
+ $instance = WPC_Shortcodes_Sanitize::post_slider_attr( $new_instance, $empty_is_false = true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
  return $instance;
38
  }
39
 
40
  function form( $instance ) {
41
+ // array_merge needs both values to be array.
42
+ if ( ! is_array( $instance ) ) {
43
+ $instance = array();
44
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
 
46
+ $o = array_merge( WPC_Shortcodes_Vars::$attr->post_slider, $instance );
47
+ $o = WPC_Shortcodes_Sanitize::post_slider_attr( $o );
48
+
49
  $args = array(
50
  'public' => true,
51
  );
57
  unset( $post_types['attachment'] );
58
  ?>
59
 
60
+ <div id="wc-shortcodes-post-slider-widget-<?php echo $this->number; ?>" class="wc-shortcodes-post-slider-widget wc-shortcodes-visual-manager wpc-ui-theme-override">
61
  <h3>Select Posts</h3>
62
  <div>
63
  <p>
64
  <label for="<?php echo $this->get_field_id('pids'); ?>"><?php _e('Post IDs:') ?></label>
65
+ <input type="text" class="wc-shortcodes-widget-option widefat wc-shortcodes-widget-autocomplete-select" id="<?php echo $this->get_field_id('pids'); ?>" data-autocomplete-type="multi" data-autocomplete-lookup="post" name="<?php echo $this->get_field_name('pids'); ?>" value="<?php echo $o['pids']; ?>" />
66
  <span class="wcs-description">Leave blank to display all posts.</span>
67
  </p>
68
  <p>
69
  <label for="<?php echo $this->get_field_id('order'); ?>"><?php _e('Order:'); ?></label>
70
+ <select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('order'); ?>" name="<?php echo $this->get_field_name('order'); ?>">
71
  <?php
72
  $options = array(
73
  'DESC' => 'DESC',
75
  );
76
  ?>
77
  <?php foreach ( $options as $key => $value ) : ?>
78
+ <option value="<?php echo $key; ?>"<?php selected( $o['order'], $key ); ?>><?php echo $value; ?></option>';
79
  <?php endforeach; ?>
80
  </select>
81
  </p>
82
  <p>
83
  <label for="<?php echo $this->get_field_id('orderby'); ?>"><?php _e('Order By:'); ?></label>
84
+ <select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('orderby'); ?>" name="<?php echo $this->get_field_name('orderby'); ?>">
85
  <?php
86
  $options = array(
87
  'none' => 'No Order',
100
  );
101
  ?>
102
  <?php foreach ( $options as $key => $value ) : ?>
103
+ <option value="<?php echo $key; ?>"<?php selected( $o['orderby'], $key ); ?>><?php echo $value; ?></option>';
104
  <?php endforeach; ?>
105
  </select>
106
  </p>
107
  <p>
108
  <label for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:'); ?></label>
109
+ <select id="<?php echo $this->get_field_id('post_type'); ?>" class="wc-shortcodes-widget-option wc-shortcodes-widget-post-type-selector" name="<?php echo $this->get_field_name('post_type'); ?>">
110
  <?php foreach ( $post_types as $key => $value ) : ?>
111
+ <option value="<?php echo $key; ?>"<?php selected( $o['post_type'], $key ); ?>><?php echo $value; ?></option>';
112
  <?php endforeach; ?>
113
  </select>
114
  </p>
115
  <p>
116
  <label for="<?php echo $this->get_field_id('taxonomy'); ?>"><?php _e('Taxonomy:'); ?></label>
117
+ <select id="<?php echo $this->get_field_id('taxonomy'); ?>" class="wc-shortcodes-widget-option wc-shortcodes-widget-taxonomy-selector" name="<?php echo $this->get_field_name('taxonomy'); ?>">
118
+ <option value=""<?php selected( $o['taxonomy'], "" ); ?>>No Taxonomy</option>';
119
  <?php foreach ( $post_types as $post_type_name ) : ?>
120
  <?php $taxonomies = get_object_taxonomies( $post_type_name, 'names' ); ?>
121
  <?php if ( $taxonomies ) : ?>
122
  <?php foreach ( $taxonomies as $key ) : ?>
123
+ <option value="<?php echo $key; ?>"<?php selected( $o['taxonomy'], $key ); ?> data-post-type="<?php echo $post_type_name; ?>"><?php echo $key; ?></option>
124
  <?php endforeach; ?>
125
  <?php endif; ?>
126
  <?php endforeach; ?>
128
  </p>
129
  <p>
130
  <label for="<?php echo $this->get_field_id('terms'); ?>"><?php _e('Terms:') ?></label>
131
+ <input type="text" class="wc-shortcodes-widget-option widefat wc-shortcodes-widget-autocomplete-select" id="<?php echo $this->get_field_id('terms'); ?>" data-autocomplete-type="multi" data-autocomplete-lookup="terms" name="<?php echo $this->get_field_name('terms'); ?>" value="<?php echo $o['terms']; ?>" />
132
  <span class="wcs-description">Leave blank to display all terms.</span>
133
  </p>
134
  <p>
135
  <label for="<?php echo $this->get_field_id('posts_per_page'); ?>"><?php _e('Posts Per Page:') ?></label>
136
+ <input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('posts_per_page'); ?>" name="<?php echo $this->get_field_name('posts_per_page'); ?>" value="<?php echo $o['posts_per_page']; ?>" />
137
  <span class="wcs-description">Enter -1 for unlimited posts.</span>
138
  </p>
139
  <p>
140
+ <input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('ignore_sticky_posts'); ?>" name="<?php echo $this->get_field_name('ignore_sticky_posts'); ?>" value="1" <?php checked( $o['ignore_sticky_posts'], 1 ); ?> />
141
  <label for="<?php echo $this->get_field_id('ignore_sticky_posts'); ?>"><?php _e('Ignore Sticky Posts') ?></label>
142
  </p>
143
  </div>
144
  <h3>Content</h3>
145
  <div>
146
  <p>
147
+ <input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('show_meta_category'); ?>" name="<?php echo $this->get_field_name('show_meta_category'); ?>" value="1" <?php checked( $o['show_meta_category'], 1 ); ?> />
148
  <label for="<?php echo $this->get_field_id('show_meta_category'); ?>"><?php _e('Show Meta Category') ?></label>
149
  </p>
150
  <p>
151
+ <input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('show_title'); ?>" name="<?php echo $this->get_field_name('show_title'); ?>" value="1" <?php checked( $o['show_title'], 1 ); ?> />
152
  <label for="<?php echo $this->get_field_id('show_title'); ?>"><?php _e('Show Title') ?></label>
153
  </p>
154
  <p>
155
+ <input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('show_content'); ?>" name="<?php echo $this->get_field_name('show_content'); ?>" value="1" <?php checked( $o['show_content'], 1 ); ?> />
156
  <label for="<?php echo $this->get_field_id('show_content'); ?>"><?php _e('Show Content') ?></label>
157
  </p>
158
  <p>
159
  <label for="<?php echo $this->get_field_id('readmore'); ?>"><?php _e('Read More Text:') ?></label>
160
+ <input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('readmore'); ?>" name="<?php echo $this->get_field_name('readmore'); ?>" value="<?php echo $o['readmore']; ?>" />
161
  </p>
162
  <p>
163
  <label for="<?php echo $this->get_field_id('button_class'); ?>"><?php _e('Button Class:') ?></label>
164
+ <input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('button_class'); ?>" name="<?php echo $this->get_field_name('button_class'); ?>" value="<?php echo $o['button_class']; ?>" />
165
  </p>
166
  <p>
167
  <label for="<?php echo $this->get_field_id('size'); ?>"><?php _e('Image Size:'); ?></label>
168
+ <select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('size'); ?>" name="<?php echo $this->get_field_name('size'); ?>">
169
  <?php
170
  $sizes = apply_filters( 'image_size_names_choose', array(
171
  'thumbnail' => __('Thumbnail'),
175
  ));
176
  ?>
177
  <?php foreach ( $sizes as $key => $value ) : ?>
178
+ <option value="<?php echo $key; ?>"<?php selected( $o['size'], $key ); ?>><?php echo $value; ?></option>
179
  <?php endforeach; ?>
180
  </select>
181
  </p>
182
  <p>
183
  <label for="<?php echo $this->get_field_id('heading_type'); ?>"><?php _e('Heading Type:'); ?></label>
184
+ <select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('heading_type'); ?>" name="<?php echo $this->get_field_name('heading_type'); ?>">
185
  <?php
186
  $options = array(
187
  'h1' => 'H1',
193
  );
194
  ?>
195
  <?php foreach ( $options as $key => $value ) : ?>
196
+ <option value="<?php echo $key; ?>"<?php selected( $o['heading_type'], $key ); ?>><?php echo $value; ?></option>';
197
  <?php endforeach; ?>
198
  </select>
199
  </p>
202
  <div>
203
  <p>
204
  <label for="<?php echo $this->get_field_id('template'); ?>"><?php _e('Template:'); ?></label>
205
+ <select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('template'); ?>" name="<?php echo $this->get_field_name('template'); ?>">
206
  <?php
207
  $options = array(
208
  'slider1' => 'Slider 1',
210
  );
211
  ?>
212
  <?php foreach ( $options as $key => $value ) : ?>
213
+ <option value="<?php echo $key; ?>"<?php selected( $o['template'], $key ); ?>><?php echo $value; ?></option>';
214
  <?php endforeach; ?>
215
  </select>
216
  </p>
217
  <p>
218
  <label for="<?php echo $this->get_field_id('heading_size'); ?>"><?php _e('Heading Size:') ?></label>
219
+ <input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('heading_size'); ?>" name="<?php echo $this->get_field_name('heading_size'); ?>" value="<?php echo $o['heading_size']; ?>" />
220
  </p>
221
  <p>
222
  <label for="<?php echo $this->get_field_id('mobile_heading_size'); ?>"><?php _e('Mobile Heading Size:') ?></label>
223
+ <input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('mobile_heading_size'); ?>" name="<?php echo $this->get_field_name('mobile_heading_size'); ?>" value="<?php echo $o['mobile_heading_size']; ?>" />
224
  </p>
225
  <p>
226
  <label for="<?php echo $this->get_field_id('excerpt_length'); ?>"><?php _e('Excerpt Length:') ?></label>
227
+ <input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('excerpt_length'); ?>" name="<?php echo $this->get_field_name('excerpt_length'); ?>" value="<?php echo $o['excerpt_length']; ?>" />
228
  </p>
229
  <p>
230
  <label for="<?php echo $this->get_field_id('desktop_height'); ?>"><?php _e('Desktop Height:') ?></label>
231
+ <input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('desktop_height'); ?>" name="<?php echo $this->get_field_name('desktop_height'); ?>" value="<?php echo $o['desktop_height']; ?>" />
232
  </p>
233
  <p>
234
  <label for="<?php echo $this->get_field_id('laptop_height'); ?>"><?php _e('Laptop Height:') ?></label>
235
+ <input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('laptop_height'); ?>" name="<?php echo $this->get_field_name('laptop_height'); ?>" value="<?php echo $o['laptop_height']; ?>" />
236
  </p>
237
  <p>
238
  <label for="<?php echo $this->get_field_id('mobile_height'); ?>"><?php _e('Mobile Height:') ?></label>
239
+ <input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('mobile_height'); ?>" name="<?php echo $this->get_field_name('mobile_height'); ?>" value="<?php echo $o['mobile_height']; ?>" />
240
  </p>
241
  </div>
242
  <h3>Slider Settings</h3>
243
  <div>
244
  <p>
245
  <label for="<?php echo $this->get_field_id('slider_mode'); ?>"><?php _e('Slider Mode:'); ?></label>
246
+ <select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('slider_mode'); ?>" name="<?php echo $this->get_field_name('slider_mode'); ?>">
247
  <?php
248
  $options = array(
249
  'fade' => 'Fade',
252
  );
253
  ?>
254
  <?php foreach ( $options as $key => $value ) : ?>
255
+ <option value="<?php echo $key; ?>"<?php selected( $o['slider_mode'], $key ); ?>><?php echo $value; ?></option>';
256
  <?php endforeach; ?>
257
  </select>
258
  </p>
259
  <p>
260
  <label for="<?php echo $this->get_field_id('slider_pause'); ?>"><?php _e('Slider Pause:') ?></label>
261
+ <input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('slider_pause'); ?>" name="<?php echo $this->get_field_name('slider_pause'); ?>" value="<?php echo $o['slider_pause']; ?>" />
262
  <span class="wcs-description">Enter number in milliseconds.</span>
263
  </p>
264
  <p>
265
+ <input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('slider_auto'); ?>" name="<?php echo $this->get_field_name('slider_auto'); ?>" value="1" <?php checked( $o['slider_auto'], 1 ); ?> />
266
  <label for="<?php echo $this->get_field_id('slider_auto'); ?>"><?php _e('Enable Auto Transition') ?></label>
267
  </p>
268
  </div>
271
  <script type="text/javascript">
272
  /* <![CDATA[ */
273
  jQuery(document).ready(function($){
274
+ $('#wc-shortcodes-post-slider-widget-<?php echo $this->number; ?>').accordion({heightStyle: "content"}).wcPostsWidget();
275
  });
276
  /* ]]> */
277
  </script>
public/widgets/widget-posts.php ADDED
@@ -0,0 +1,291 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WC_Shortcodes_Posts_Widget
4
+ *
5
+ * @uses WP
6
+ * @uses _Widget
7
+ */
8
+ class WC_Shortcodes_Posts_Widget extends WP_Widget {
9
+ function __construct() {
10
+
11
+ $widget_ops = array( 'description' => __('Add your posts to your widget area.') );
12
+ parent::__construct( 'wc_shortcodes_posts', __('Posts'), $widget_ops );
13
+ }
14
+
15
+ function widget($args, $instance) {
16
+ $shortcode = array();
17
+ foreach ( $instance as $key => $value ) {
18
+ $shortcode[] = $key . '="' . $value . '"';
19
+ }
20
+
21
+ if ( ! empty( $shortcode ) ) {
22
+ $shortcode = implode( " ", $shortcode );
23
+ $shortcode = '[wc_posts ' . $shortcode . '][/wc_posts]';
24
+ }
25
+ else {
26
+ $shortcode = '[wc_posts][/wc_posts]';
27
+ }
28
+
29
+ echo $args['before_widget'];
30
+ echo do_shortcode( $shortcode );
31
+ echo $args['after_widget'];
32
+ }
33
+
34
+ function update( $new_instance, $old_instance ) {
35
+ $instance = WPC_Shortcodes_Sanitize::posts_attr( $new_instance, $empty_is_false = true );
36
+
37
+ return $instance;
38
+ }
39
+
40
+ function form( $instance ) {
41
+ // array_merge needs both values to be array.
42
+ if ( ! is_array( $instance ) ) {
43
+ $instance = array();
44
+ }
45
+
46
+ $instance = WPC_Shortcodes_Sanitize::posts_attr_key_change( $instance );
47
+ $o = array_merge( WPC_Shortcodes_Vars::$attr->posts, $instance );
48
+ $o = WPC_Shortcodes_Sanitize::posts_attr( $o );
49
+
50
+ $args = array(
51
+ 'public' => true,
52
+ );
53
+ $post_types = get_post_types( $args );
54
+ unset( $post_types['attachment'] );
55
+ ?>
56
+
57
+ <div id="wc-shortcodes-posts-widget-<?php echo $this->number; ?>" class="wc-shortcodes-posts-widget wc-shortcodes-visual-manager wpc-ui-theme-override">
58
+ <h3>Select Posts</h3>
59
+ <div>
60
+ <p>
61
+ <label for="<?php echo $this->get_field_id('pids'); ?>"><?php _e('Post IDs:') ?></label>
62
+ <input type="text" class="wc-shortcodes-widget-option widefat wc-shortcodes-widget-autocomplete-select" id="<?php echo $this->get_field_id('pids'); ?>" data-autocomplete-type="multi" data-autocomplete-lookup="post" name="<?php echo $this->get_field_name('pids'); ?>" value="<?php echo $o['pids']; ?>" />
63
+ <span class="wcs-description">Leave blank to display all posts.</span>
64
+ </p>
65
+ <p>
66
+ <label for="<?php echo $this->get_field_id('order'); ?>"><?php _e('Order:'); ?></label>
67
+ <select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('order'); ?>" name="<?php echo $this->get_field_name('order'); ?>">
68
+ <?php
69
+ $options = array(
70
+ 'DESC' => 'DESC',
71
+ 'ASC' => 'ASC',
72
+ );
73
+ ?>
74
+ <?php foreach ( $options as $key => $value ) : ?>
75
+ <option value="<?php echo $key; ?>"<?php selected( $o['order'], $key ); ?>><?php echo $value; ?></option>';
76
+ <?php endforeach; ?>
77
+ </select>
78
+ </p>
79
+ <p>
80
+ <label for="<?php echo $this->get_field_id('orderby'); ?>"><?php _e('Order By:'); ?></label>
81
+ <select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('orderby'); ?>" name="<?php echo $this->get_field_name('orderby'); ?>">
82
+ <?php
83
+ $options = array(
84
+ 'none' => 'No Order',
85
+ 'ID' => 'Post ID',
86
+ 'author' => 'Author',
87
+ 'title' => 'Title',
88
+ 'name' => 'Post Name',
89
+ 'type' => 'Post Type',
90
+ 'date' => 'Date',
91
+ 'modified' => 'Last Modified Date',
92
+ 'parent' => 'Post/Page Parent ID',
93
+ 'rand' => 'Random',
94
+ 'comment_count' => 'Number of Comments',
95
+ 'menu_order' => 'Menu Order',
96
+ 'post__in' => 'Preserve Post ID Order',
97
+ );
98
+ ?>
99
+ <?php foreach ( $options as $key => $value ) : ?>
100
+ <option value="<?php echo $key; ?>"<?php selected( $o['orderby'], $key ); ?>><?php echo $value; ?></option>';
101
+ <?php endforeach; ?>
102
+ </select>
103
+ </p>
104
+ <p>
105
+ <label for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:'); ?></label>
106
+ <select id="<?php echo $this->get_field_id('post_type'); ?>" class="wc-shortcodes-widget-option wc-shortcodes-widget-post-type-selector" name="<?php echo $this->get_field_name('post_type'); ?>">
107
+ <?php foreach ( $post_types as $key => $value ) : ?>
108
+ <option value="<?php echo $key; ?>"<?php selected( $o['post_type'], $key ); ?>><?php echo $value; ?></option>';
109
+ <?php endforeach; ?>
110
+ </select>
111
+ </p>
112
+ <p>
113
+ <label for="<?php echo $this->get_field_id('taxonomy'); ?>"><?php _e('Taxonomy:'); ?></label>
114
+ <select id="<?php echo $this->get_field_id('taxonomy'); ?>" class="wc-shortcodes-widget-option wc-shortcodes-widget-taxonomy-selector" name="<?php echo $this->get_field_name('taxonomy'); ?>">
115
+ <option value=""<?php selected( $o['taxonomy'], "" ); ?>>No Taxonomy</option>';
116
+ <?php foreach ( $post_types as $post_type_name ) : ?>
117
+ <?php $taxonomies = get_object_taxonomies( $post_type_name, 'names' ); ?>
118
+ <?php if ( $taxonomies ) : ?>
119
+ <?php foreach ( $taxonomies as $key ) : ?>
120
+ <option value="<?php echo $key; ?>"<?php selected( $o['taxonomy'], $key ); ?> data-post-type="<?php echo $post_type_name; ?>"><?php echo $key; ?></option>
121
+ <?php endforeach; ?>
122
+ <?php endif; ?>
123
+ <?php endforeach; ?>
124
+ </select>
125
+ </p>
126
+ <p>
127
+ <label for="<?php echo $this->get_field_id('terms'); ?>"><?php _e('Terms:') ?></label>
128
+ <input type="text" class="wc-shortcodes-widget-option widefat wc-shortcodes-widget-autocomplete-select" id="<?php echo $this->get_field_id('terms'); ?>" data-autocomplete-type="multi" data-autocomplete-lookup="terms" name="<?php echo $this->get_field_name('terms'); ?>" value="<?php echo $o['terms']; ?>" />
129
+ <span class="wcs-description">Leave blank to display all terms.</span>
130
+ </p>
131
+ <p>
132
+ <label for="<?php echo $this->get_field_id('posts_per_page'); ?>"><?php _e('Posts Per Page:') ?></label>
133
+ <input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('posts_per_page'); ?>" name="<?php echo $this->get_field_name('posts_per_page'); ?>" value="<?php echo $o['posts_per_page']; ?>" />
134
+ <span class="wcs-description">Enter -1 for unlimited posts.</span>
135
+ </p>
136
+ <p>
137
+ <input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('ignore_sticky_posts'); ?>" name="<?php echo $this->get_field_name('ignore_sticky_posts'); ?>" value="1" <?php checked( $o['ignore_sticky_posts'], 1 ); ?> />
138
+ <label for="<?php echo $this->get_field_id('ignore_sticky_posts'); ?>"><?php _e('Ignore Sticky Posts') ?></label>
139
+ </p>
140
+ </div>
141
+ <h3>Content</h3>
142
+ <div>
143
+ <p>
144
+ <input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('show_title'); ?>" name="<?php echo $this->get_field_name('show_title'); ?>" value="1" <?php checked( $o['show_title'], 1 ); ?> />
145
+ <label for="<?php echo $this->get_field_id('show_title'); ?>"><?php _e('Show Title') ?></label>
146
+ </p>
147
+ <p>
148
+ <input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('show_meta_all'); ?>" name="<?php echo $this->get_field_name('show_meta_all'); ?>" value="1" <?php checked( $o['show_meta_all'], 1 ); ?> />
149
+ <label for="<?php echo $this->get_field_id('show_meta_all'); ?>"><?php _e('Show Meta All') ?></label>
150
+ </p>
151
+ <p>
152
+ <input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('show_meta_author'); ?>" name="<?php echo $this->get_field_name('show_meta_author'); ?>" value="1" <?php checked( $o['show_meta_author'], 1 ); ?> />
153
+ <label for="<?php echo $this->get_field_id('show_meta_author'); ?>"><?php _e('Show Meta Author') ?></label>
154
+ </p>
155
+ <p>
156
+ <input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('show_meta_date'); ?>" name="<?php echo $this->get_field_name('show_meta_date'); ?>" value="1" <?php checked( $o['show_meta_date'], 1 ); ?> />
157
+ <label for="<?php echo $this->get_field_id('show_meta_date'); ?>"><?php _e('Show Meta Date') ?></label>
158
+ </p>
159
+ <p>
160
+ <input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('show_meta_comments'); ?>" name="<?php echo $this->get_field_name('show_meta_comments'); ?>" value="1" <?php checked( $o['show_meta_comments'], 1 ); ?> />
161
+ <label for="<?php echo $this->get_field_id('show_meta_comments'); ?>"><?php _e('Show Meta Comments') ?></label>
162
+ </p>
163
+ <p>
164
+ <input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('show_thumbnail'); ?>" name="<?php echo $this->get_field_name('show_thumbnail'); ?>" value="1" <?php checked( $o['show_thumbnail'], 1 ); ?> />
165
+ <label for="<?php echo $this->get_field_id('show_thumbnail'); ?>"><?php _e('Show Thumbnail') ?></label>
166
+ </p>
167
+ <p>
168
+ <input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('show_content'); ?>" name="<?php echo $this->get_field_name('show_content'); ?>" value="1" <?php checked( $o['show_content'], 1 ); ?> />
169
+ <label for="<?php echo $this->get_field_id('show_content'); ?>"><?php _e('Show Content') ?></label>
170
+ </p>
171
+ <p>
172
+ <input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('show_paging'); ?>" name="<?php echo $this->get_field_name('show_paging'); ?>" value="1" <?php checked( $o['show_paging'], 1 ); ?> />
173
+ <label for="<?php echo $this->get_field_id('show_paging'); ?>"><?php _e('Show Paging') ?></label>
174
+ </p>
175
+ <p>
176
+ <label for="<?php echo $this->get_field_id('size'); ?>"><?php _e('Image Size:'); ?></label>
177
+ <select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('size'); ?>" name="<?php echo $this->get_field_name('size'); ?>">
178
+ <?php
179
+ $sizes = apply_filters( 'image_size_names_choose', array(
180
+ 'thumbnail' => __('Thumbnail'),
181
+ 'medium' => __('Medium'),
182
+ 'large' => __('Large'),
183
+ 'full' => __('Full Size'),
184
+ ));
185
+ ?>
186
+ <?php foreach ( $sizes as $key => $value ) : ?>
187
+ <option value="<?php echo $key; ?>"<?php selected( $o['size'], $key ); ?>><?php echo $value; ?></option>
188
+ <?php endforeach; ?>
189
+ </select>
190
+ </p>
191
+ <p>
192
+ <input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('filtering'); ?>" name="<?php echo $this->get_field_name('filtering'); ?>" value="1" <?php checked( $o['filtering'], 1 ); ?> />
193
+ <label for="<?php echo $this->get_field_id('filtering'); ?>"><?php _e('Enable Post Filtering') ?></label>
194
+ </p>
195
+ </div>
196
+ <h3>Style</h3>
197
+ <div>
198
+ <p>
199
+ <label for="<?php echo $this->get_field_id('columns'); ?>"><?php _e('Columns:'); ?></label>
200
+ <select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('columns'); ?>" name="<?php echo $this->get_field_name('columns'); ?>">
201
+ <?php
202
+ $options = array(
203
+ '1' => '1',
204
+ '2' => '2',
205
+ '3' => '3',
206
+ '4' => '4',
207
+ '5' => '5',
208
+ '6' => '6',
209
+ '7' => '7',
210
+ '8' => '8',
211
+ '9' => '9',
212
+ );
213
+ ?>
214
+ <?php foreach ( $options as $key => $value ) : ?>
215
+ <option value="<?php echo $key; ?>"<?php selected( $o['columns'], $key ); ?>><?php echo $value; ?></option>';
216
+ <?php endforeach; ?>
217
+ </select>
218
+ </p>
219
+ <p>
220
+ <label for="<?php echo $this->get_field_id('gutter_space'); ?>"><?php _e('Gutter Space:') ?></label>
221
+ <input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('gutter_space'); ?>" name="<?php echo $this->get_field_name('gutter_space'); ?>" value="<?php echo $o['gutter_space']; ?>" />
222
+ <span class="wcs-description">Enter pixel value between 0 and 50.</span>
223
+ </p>
224
+ <p>
225
+ <label for="<?php echo $this->get_field_id('heading_type'); ?>"><?php _e('Heading Type:'); ?></label>
226
+ <select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('heading_type'); ?>" name="<?php echo $this->get_field_name('heading_type'); ?>">
227
+ <?php
228
+ $options = array(
229
+ 'h1' => 'H1',
230
+ 'h2' => 'H2',
231
+ 'h3' => 'H3',
232
+ 'h4' => 'H4',
233
+ 'h5' => 'H5',
234
+ 'h6' => 'H6',
235
+ );
236
+ ?>
237
+ <?php foreach ( $options as $key => $value ) : ?>
238
+ <option value="<?php echo $key; ?>"<?php selected( $o['heading_type'], $key ); ?>><?php echo $value; ?></option>';
239
+ <?php endforeach; ?>
240
+ </select>
241
+ </p>
242
+ <p>
243
+ <label for="<?php echo $this->get_field_id('layout'); ?>"><?php _e('Layout:'); ?></label>
244
+ <select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('layout'); ?>" name="<?php echo $this->get_field_name('layout'); ?>">
245
+ <?php
246
+ $options = array(
247
+ 'masonry' => 'Masonry',
248
+ 'grid' => 'Grid',
249
+ );
250
+ ?>
251
+ <?php foreach ( $options as $key => $value ) : ?>
252
+ <option value="<?php echo $key; ?>"<?php selected( $o['layout'], $key ); ?>><?php echo $value; ?></option>';
253
+ <?php endforeach; ?>
254
+ </select>
255
+ </p>
256
+ <p>
257
+ <label for="<?php echo $this->get_field_id('template'); ?>"><?php _e('Template:'); ?></label>
258
+ <select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('template'); ?>" name="<?php echo $this->get_field_name('template'); ?>">
259
+ <?php
260
+ $options = array(
261
+ 'box' => 'Box',
262
+ 'borderless' => 'Borderless',
263
+ );
264
+ ?>
265
+ <?php foreach ( $options as $key => $value ) : ?>
266
+ <option value="<?php echo $key; ?>"<?php selected( $o['template'], $key ); ?>><?php echo $value; ?></option>';
267
+ <?php endforeach; ?>
268
+ </select>
269
+ </p>
270
+ <p>
271
+ <label for="<?php echo $this->get_field_id('excerpt_length'); ?>"><?php _e('Excerpt Length:') ?></label>
272
+ <input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('excerpt_length'); ?>" name="<?php echo $this->get_field_name('excerpt_length'); ?>" value="<?php echo $o['excerpt_length']; ?>" />
273
+ </p>
274
+ <p>
275
+ <label for="<?php echo $this->get_field_id('date_format'); ?>"><?php _e('Date Format:') ?></label>
276
+ <input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('date_format'); ?>" name="<?php echo $this->get_field_name('date_format'); ?>" value="<?php echo $o['date_format']; ?>" />
277
+ <span class="wcs-description"><a href="https://codex.wordpress.org/Formatting_Date_and_Time" target="_blank">Documentation on date and time formatting</a></span>
278
+ </p>
279
+ </div>
280
+ </div>
281
+
282
+ <script type="text/javascript">
283
+ /* <![CDATA[ */
284
+ jQuery(document).ready(function($){
285
+ $('#wc-shortcodes-posts-widget-<?php echo $this->number; ?>').accordion({heightStyle: "content"}).wcPostsWidget();
286
+ });
287
+ /* ]]> */
288
+ </script>
289
+ <?php
290
+ }
291
+ }
readme.txt CHANGED
@@ -88,6 +88,10 @@ Use the shortcode manager in the TinyMCE text editor
88
 
89
  == Changelog ==
90
 
 
 
 
 
91
  = Version 3.2 =
92
 
93
  * updated old image path to new image path
88
 
89
  == Changelog ==
90
 
91
+ = Version 3.3 =
92
+
93
+ * updated posts shortcode to include visual manager for attributes
94
+
95
  = Version 3.2 =
96
 
97
  * updated old image path to new image path
wc-shortcodes.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://webplantmedia.com/starter-themes/wordpresscanvas/features/sho
5
  Description: A family of shortcodes to enhance site functionality.
6
  Author: Chris Baldelomar
7
  Author URI: http://webplantmedia.com/
8
- Version: 3.2
9
  License: GPLv2 or later
10
  */
11
 
@@ -47,8 +47,6 @@ require_once( plugin_dir_path( __FILE__ ) . 'public/class-widgets.php' );
47
  // Initialize classes.
48
  add_action( 'plugins_loaded', array( 'WPC_Shortcodes_Public', 'get_instance' ) );
49
 
50
- add_action( 'plugins_loaded', array( 'WPC_Shortcodes_Sanitize', 'get_instance' ) );
51
-
52
  add_action( 'plugins_loaded', array( 'WPC_Shortcodes_Register', 'get_instance' ) );
53
 
54
  add_action( 'plugins_loaded', array( 'WPC_Shortcodes_Hooks', 'get_instance' ) );
5
  Description: A family of shortcodes to enhance site functionality.
6
  Author: Chris Baldelomar
7
  Author URI: http://webplantmedia.com/
8
+ Version: 3.3
9
  License: GPLv2 or later
10
  */
11
 
47
  // Initialize classes.
48
  add_action( 'plugins_loaded', array( 'WPC_Shortcodes_Public', 'get_instance' ) );
49
 
 
 
50
  add_action( 'plugins_loaded', array( 'WPC_Shortcodes_Register', 'get_instance' ) );
51
 
52
  add_action( 'plugins_loaded', array( 'WPC_Shortcodes_Hooks', 'get_instance' ) );