Shortcodes by Angie Makes - Version 1.95

Version Description

Download this release

Release Info

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

Code changes from version 1.94 to 1.95

README.md CHANGED
@@ -66,6 +66,12 @@ Use the shortcode manager in the TinyMCE text editor
66
 
67
  ## Changelog ##
68
 
 
 
 
 
 
 
69
  ### Version 1.94
70
 
71
  * Added post_slider shortcode
66
 
67
  ## Changelog ##
68
 
69
+ ### Version 1.95
70
+
71
+ * settings framework 1.0.2
72
+ * theme reset option when supported themes are activated
73
+ * Updated post slider function and style
74
+
75
  ### Version 1.94
76
 
77
  * Added post_slider shortcode
includes/css/style.css CHANGED
@@ -1851,11 +1851,38 @@ pre.pre-wrap {
1851
  vertical-align: middle;
1852
  text-align: center;
1853
  border-width: 0;
 
 
 
 
 
1854
  }
1855
- .wc-shortcodes-post-slider-wrapper * {
1856
- color: inherit !important;
1857
- border-color: inherit !important;
 
 
 
 
 
 
1858
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1859
  .wc-shortcodes-post-slide-content-inner {
1860
  max-width: 600px;
1861
  margin-left: auto;
@@ -1863,6 +1890,12 @@ pre.pre-wrap {
1863
  padding: 1.5em;
1864
  /* background-color: rgba(0, 0, 0, 0.3); */
1865
  }
 
 
 
 
 
 
1866
  /* DIRECTION CONTROLS (NEXT / PREV) */
1867
  .bx-wrapper .bx-controls-direction a {
1868
  position: absolute;
@@ -1877,6 +1910,7 @@ pre.pre-wrap {
1877
  border-radius: 9999px;
1878
  text-align:center;
1879
  opacity: 0;
 
1880
  }
1881
  .bx-wrapper .bx-controls-direction a.disabled {
1882
  display: none;
@@ -1907,13 +1941,6 @@ pre.pre-wrap {
1907
  .wc-shortcodes-read-more {
1908
  display: block;
1909
  }
1910
- .wc-shortcodes-post-slide-button {
1911
- padding: 0.625em 0.8125em;
1912
- border-width: 2px;
1913
- border-style: solid;
1914
- text-decoration: none;
1915
- display: inline-block;
1916
- }
1917
  .wc-shortcodes-post-slide-button:hover {
1918
  text-decoration: none;
1919
  }
1851
  vertical-align: middle;
1852
  text-align: center;
1853
  border-width: 0;
1854
+ padding: 1.5em;
1855
+ }
1856
+ .wc-shortcodes-post-slide-content .wc-shortcodes-entry-title {
1857
+ margin-top: 0;
1858
+ margin-bottom: 0;
1859
  }
1860
+ .wc-shortcodes-post-slide-content .wc-shortcodes-entry-header {
1861
+ margin-top: 1.5em;
1862
+ margin-bottom: 1.5em;
1863
+ }
1864
+
1865
+ /* template slider1 */
1866
+ .wc-shortcodes-posts-template-slider1 * {
1867
+ color: #ffffff !important;
1868
+ border-color: #ffffff !important;
1869
  }
1870
+ .wc-shortcodes-posts-template-slider1 .wc-shortcodes-post-slide-button {
1871
+ padding: 0.625em 0.8125em;
1872
+ border-width: 2px;
1873
+ border-style: solid;
1874
+ text-decoration: none;
1875
+ display: inline-block;
1876
+ }
1877
+ /* end template slider1 */
1878
+
1879
+ /* template slider2 */
1880
+ .wc-shortcodes-posts-template-slider2 .wc-shortcodes-post-slide-content-inner {
1881
+ position: relative;
1882
+ background-color: #ffffff;
1883
+ }
1884
+ /* end template slider2 */
1885
+
1886
  .wc-shortcodes-post-slide-content-inner {
1887
  max-width: 600px;
1888
  margin-left: auto;
1890
  padding: 1.5em;
1891
  /* background-color: rgba(0, 0, 0, 0.3); */
1892
  }
1893
+ .wc-shortcodes-post-slide-content-inner > *:first-child {
1894
+ margin-top: 0 !important;
1895
+ }
1896
+ .wc-shortcodes-post-slide-content-inner > *:last-child {
1897
+ margin-bottom: 0 !important;
1898
+ }
1899
  /* DIRECTION CONTROLS (NEXT / PREV) */
1900
  .bx-wrapper .bx-controls-direction a {
1901
  position: absolute;
1910
  border-radius: 9999px;
1911
  text-align:center;
1912
  opacity: 0;
1913
+ color: #ffffff;
1914
  }
1915
  .bx-wrapper .bx-controls-direction a.disabled {
1916
  display: none;
1941
  .wc-shortcodes-read-more {
1942
  display: block;
1943
  }
 
 
 
 
 
 
 
1944
  .wc-shortcodes-post-slide-button:hover {
1945
  text-decoration: none;
1946
  }
includes/mce/js/shortcodes-tinymce-4.js CHANGED
@@ -198,9 +198,15 @@
198
  }
199
  },
200
  {
201
- text: "Post Slider",
202
  onclick: function(){
203
- editor.insertContent('[wc_post_slider author="" author_name="" p="" post__in="" order="DESC" orderby="name" post_status="publish" post_type="post" posts_per_page="10" taxonomy="" field="slug" terms="" meta_category="yes" title="yes" content="yes" readmore="Continue Reading" size="full" heading_type="h2" heading_size="30" mobile_heading_size="24" excerpt_length="30" desktop_height="600" laptop_height="500" mobile_height="350" text_color="#ffffff"][/wc_post_slider]');
 
 
 
 
 
 
204
  }
205
  }
206
  ]
198
  }
199
  },
200
  {
201
+ text: "Post Slider 1",
202
  onclick: function(){
203
+ editor.insertContent('[wc_post_slider author="" author_name="" p="" post__in="" order="DESC" orderby="name" post_status="publish" post_type="post" posts_per_page="10" taxonomy="" field="slug" terms="" meta_category="yes" title="yes" content="yes" readmore="Continue Reading" button_class="" size="full" heading_type="h2" heading_size="30" mobile_heading_size="24" excerpt_length="30" desktop_height="600" laptop_height="500" mobile_height="350" template="slider1"][/wc_post_slider]');
204
+ }
205
+ },
206
+ {
207
+ text: "Post Slider 2",
208
+ onclick: function(){
209
+ editor.insertContent('[wc_post_slider author="" author_name="" p="" post__in="" order="DESC" orderby="name" post_status="publish" post_type="post" posts_per_page="10" taxonomy="" field="slug" terms="" meta_category="no" title="yes" content="yes" readmore="Continue Reading" button_class="button secondary-button" size="full" heading_type="h2" heading_size="30" mobile_heading_size="24" excerpt_length="30" desktop_height="600" laptop_height="500" mobile_height="350" template="slider2"][/wc_post_slider]');
210
  }
211
  }
212
  ]
includes/options.php CHANGED
@@ -47,6 +47,7 @@ function wc_shortcodes_options( $options ) {
47
  'icon' => 'Icon',
48
  'image' => 'Image',
49
  ),
 
50
  ),
51
  ),
52
  ),
@@ -87,6 +88,7 @@ function wc_shortcodes_options( $options ) {
87
  'icon-text' => 'Icon + Text',
88
  'text' => 'Text',
89
  ),
 
90
  ),
91
  array(
92
  'option_name' => 'share_buttons_on_post_page',
@@ -95,6 +97,7 @@ function wc_shortcodes_options( $options ) {
95
  'description' => '',
96
  'label' => 'Add share buttons to the bottom of your post pages',
97
  'type' => 'checkbox',
 
98
  'hide' => $wc_shortcodes_theme_support['share_buttons_filter_disable'],
99
  ),
100
  array(
@@ -104,6 +107,7 @@ function wc_shortcodes_options( $options ) {
104
  'description' => '',
105
  'label' => 'Add share buttons to the bottom of your posts in your blog',
106
  'type' => 'checkbox',
 
107
  'hide' => $wc_shortcodes_theme_support['share_buttons_filter_disable'],
108
  ),
109
  array(
@@ -113,6 +117,7 @@ function wc_shortcodes_options( $options ) {
113
  'description' => '',
114
  'label' => 'Add share buttons to the bottom of your posts in your category, tag, date, and author archive pages.',
115
  'type' => 'checkbox',
 
116
  'hide' => $wc_shortcodes_theme_support['share_buttons_filter_disable'],
117
  ),
118
  array(
@@ -122,6 +127,7 @@ function wc_shortcodes_options( $options ) {
122
  'description' => '',
123
  'label' => 'Add share buttons to the bottom of your WooCommerce product page.',
124
  'type' => 'checkbox',
 
125
  'hide' => $wc_shortcodes_theme_support['share_buttons_filter_disable'],
126
  ),
127
  ),
@@ -254,6 +260,7 @@ function wc_shortcodes_options( $options ) {
254
  'description' => '',
255
  'label' => 'Use shortcode CSS provided by plugin',
256
  'type' => 'checkbox',
 
257
  ),
258
  array(
259
  'option_name' => 'enable_font_awesome',
@@ -262,6 +269,7 @@ function wc_shortcodes_options( $options ) {
262
  'description' => '',
263
  'label' => 'Use font icons provided by FontAwesome',
264
  'type' => 'checkbox',
 
265
  ),
266
  ),
267
  ),
@@ -274,6 +282,13 @@ function wc_shortcodes_options( $options ) {
274
  }
275
  add_filter( 'wc_shortcodes_wpcsf_options', 'wc_shortcodes_options', 10, 1 );
276
 
 
 
 
 
 
 
 
277
  function wc_shortcodes_get_share_buttons_options() {
278
  global $wc_shortcodes_theme_support;
279
  global $wc_shortcodes_share_buttons;
@@ -291,6 +306,7 @@ function wc_shortcodes_get_share_buttons_options() {
291
  'default' => $wc_shortcodes_theme_support[ $key . '_share_text'],
292
  'description' => '',
293
  'type' => 'input',
 
294
  ),
295
  array(
296
  'option_name' => $key . '_share_font_icon',
@@ -298,6 +314,7 @@ function wc_shortcodes_get_share_buttons_options() {
298
  'default' => $wc_shortcodes_theme_support[ $key . '_share_font_icon'],
299
  'description' => '<a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank">See All Icons</a>',
300
  'type' => 'input',
 
301
  ),
302
  array(
303
  'option_name' => $key . '_share_icon',
@@ -305,6 +322,7 @@ function wc_shortcodes_get_share_buttons_options() {
305
  'default' => $wc_shortcodes_theme_support[ $key . '_share_button'],
306
  'description' => '',
307
  'type' => 'image',
 
308
  ),
309
  ),
310
  );
@@ -336,6 +354,7 @@ function wc_shortcodes_get_social_icons_options() {
336
  'default' => $wc_shortcodes_theme_support[ $key . '_font_icon'],
337
  'description' => '<a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank">See All Icons</a>',
338
  'type' => 'input',
 
339
  ),
340
  array(
341
  'option_name' => $key . '_icon',
@@ -343,6 +362,7 @@ function wc_shortcodes_get_social_icons_options() {
343
  'default' => $wc_shortcodes_theme_support[ $key . '_social_icon'],
344
  'description' => '',
345
  'type' => 'image',
 
346
  ),
347
  ),
348
  );
47
  'icon' => 'Icon',
48
  'image' => 'Image',
49
  ),
50
+ 'theme_reset' => true,
51
  ),
52
  ),
53
  ),
88
  'icon-text' => 'Icon + Text',
89
  'text' => 'Text',
90
  ),
91
+ 'theme_reset' => true,
92
  ),
93
  array(
94
  'option_name' => 'share_buttons_on_post_page',
97
  'description' => '',
98
  'label' => 'Add share buttons to the bottom of your post pages',
99
  'type' => 'checkbox',
100
+ 'theme_reset' => true,
101
  'hide' => $wc_shortcodes_theme_support['share_buttons_filter_disable'],
102
  ),
103
  array(
107
  'description' => '',
108
  'label' => 'Add share buttons to the bottom of your posts in your blog',
109
  'type' => 'checkbox',
110
+ 'theme_reset' => true,
111
  'hide' => $wc_shortcodes_theme_support['share_buttons_filter_disable'],
112
  ),
113
  array(
117
  'description' => '',
118
  'label' => 'Add share buttons to the bottom of your posts in your category, tag, date, and author archive pages.',
119
  'type' => 'checkbox',
120
+ 'theme_reset' => true,
121
  'hide' => $wc_shortcodes_theme_support['share_buttons_filter_disable'],
122
  ),
123
  array(
127
  'description' => '',
128
  'label' => 'Add share buttons to the bottom of your WooCommerce product page.',
129
  'type' => 'checkbox',
130
+ 'theme_reset' => true,
131
  'hide' => $wc_shortcodes_theme_support['share_buttons_filter_disable'],
132
  ),
133
  ),
260
  'description' => '',
261
  'label' => 'Use shortcode CSS provided by plugin',
262
  'type' => 'checkbox',
263
+ 'theme_reset' => true,
264
  ),
265
  array(
266
  'option_name' => 'enable_font_awesome',
269
  'description' => '',
270
  'label' => 'Use font icons provided by FontAwesome',
271
  'type' => 'checkbox',
272
+ 'theme_reset' => true,
273
  ),
274
  ),
275
  ),
282
  }
283
  add_filter( 'wc_shortcodes_wpcsf_options', 'wc_shortcodes_options', 10, 1 );
284
 
285
+ function wc_shortcodes_theme_support() {
286
+ global $wc_shortcodes_theme_support;
287
+
288
+ return $wc_shortcodes_theme_support;
289
+ }
290
+ add_filter( 'wc_shortcodes_wpcsf_theme_support', 'wc_shortcodes_theme_support', 10, 1 );
291
+
292
  function wc_shortcodes_get_share_buttons_options() {
293
  global $wc_shortcodes_theme_support;
294
  global $wc_shortcodes_share_buttons;
306
  'default' => $wc_shortcodes_theme_support[ $key . '_share_text'],
307
  'description' => '',
308
  'type' => 'input',
309
+ 'theme_reset' => true,
310
  ),
311
  array(
312
  'option_name' => $key . '_share_font_icon',
314
  'default' => $wc_shortcodes_theme_support[ $key . '_share_font_icon'],
315
  'description' => '<a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank">See All Icons</a>',
316
  'type' => 'input',
317
+ 'theme_reset' => true,
318
  ),
319
  array(
320
  'option_name' => $key . '_share_icon',
322
  'default' => $wc_shortcodes_theme_support[ $key . '_share_button'],
323
  'description' => '',
324
  'type' => 'image',
325
+ 'theme_reset' => true,
326
  ),
327
  ),
328
  );
354
  'default' => $wc_shortcodes_theme_support[ $key . '_font_icon'],
355
  'description' => '<a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank">See All Icons</a>',
356
  'type' => 'input',
357
+ 'theme_reset' => true,
358
  ),
359
  array(
360
  'option_name' => $key . '_icon',
362
  'default' => $wc_shortcodes_theme_support[ $key . '_social_icon'],
363
  'description' => '',
364
  'type' => 'image',
365
+ 'theme_reset' => true,
366
  ),
367
  ),
368
  );
includes/shortcode-functions.php CHANGED
@@ -1372,6 +1372,7 @@ if( ! function_exists( 'wc_shortcodes_post_slider' ) ) {
1372
  'title' => true, // show heading?
1373
  'content' => true, // show main content?
1374
  'readmore' => 'Continue Reading', // show main content?
 
1375
 
1376
  'size' => 'full', // default thumbnail size
1377
 
@@ -1379,12 +1380,11 @@ if( ! function_exists( 'wc_shortcodes_post_slider' ) ) {
1379
  'heading_size' => '30',
1380
  'mobile_heading_size' => '24',
1381
  'layout' => 'bxslider', // blog layout
1382
- 'template' => 'slider',
1383
  'excerpt_length' => '55',
1384
  'desktop_height' => '650',
1385
  'laptop_height' => '500',
1386
  'mobile_height' => '350',
1387
- 'text_color' => '#ffffff',
1388
  ), $atts );
1389
 
1390
  // fix bug with title argument being added to WP_Query() in 4.4
@@ -1393,6 +1393,7 @@ if( ! function_exists( 'wc_shortcodes_post_slider' ) ) {
1393
  'title',
1394
  'content',
1395
  'readmore',
 
1396
 
1397
  'size',
1398
 
@@ -1405,7 +1406,6 @@ if( ! function_exists( 'wc_shortcodes_post_slider' ) ) {
1405
  'desktop_height',
1406
  'laptop_height',
1407
  'mobile_height',
1408
- 'text_color',
1409
  );
1410
 
1411
  $display = array();
@@ -1420,9 +1420,9 @@ if( ! function_exists( 'wc_shortcodes_post_slider' ) ) {
1420
  $display['layout'] = 'bxslider';
1421
  }
1422
 
1423
- $valid_templates = array( 'slider' );
1424
  if ( ! in_array( $display['template'], $valid_templates ) ) {
1425
- $display['template'] = 'slider';
1426
  }
1427
 
1428
  // clean input values
@@ -1449,6 +1449,9 @@ if( ! function_exists( 'wc_shortcodes_post_slider' ) ) {
1449
  $display['heading_size'] = (int) $display['heading_size'];
1450
  $display['mobile_heading_size'] = (int) $display['mobile_heading_size'];
1451
 
 
 
 
1452
 
1453
  // add tax query if user specified
1454
  if ( ! empty( $wpc_term ) ) {
@@ -1474,6 +1477,7 @@ if( ! function_exists( 'wc_shortcodes_post_slider' ) ) {
1474
  $valid_headings = array( 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' );
1475
  $display['heading_type'] = in_array( $display['heading_type'], $valid_headings ) ? $display['heading_type'] : 'h2';
1476
 
 
1477
  ($display['title'] == "yes") ? ($display['title'] = true) : ($display['title'] = false);
1478
  ($display['content'] == "yes") ? ($display['content'] = true) : ($display['content'] = false);
1479
  ($atts['order'] == "ASC") ? ($atts['order'] = "ASC") : ($atts['order'] = "DESC");
@@ -1518,7 +1522,7 @@ if( ! function_exists( 'wc_shortcodes_post_slider' ) ) {
1518
  $class[] = 'wc-shortcodes-posts-layout-' . $display['layout'];
1519
  $class[] = 'wc-shortcodes-posts-template-' . $display['template'];
1520
 
1521
- $html .= '<div id="" class="wc-shortcodes-post-slider-wrapper" style="color:'.$display['text_color'].';">';
1522
  $html .= '<div id="wc-shortcodes-post-slider-'.$instance.'" class="' . implode( ' ', $class ) . '">';
1523
 
1524
  while( $wc_shortcodes_posts_query->have_posts() ) :
1372
  'title' => true, // show heading?
1373
  'content' => true, // show main content?
1374
  'readmore' => 'Continue Reading', // show main content?
1375
+ 'button_class' => 'button', // show main content?
1376
 
1377
  'size' => 'full', // default thumbnail size
1378
 
1380
  'heading_size' => '30',
1381
  'mobile_heading_size' => '24',
1382
  'layout' => 'bxslider', // blog layout
1383
+ 'template' => 'slider1',
1384
  'excerpt_length' => '55',
1385
  'desktop_height' => '650',
1386
  'laptop_height' => '500',
1387
  'mobile_height' => '350',
 
1388
  ), $atts );
1389
 
1390
  // fix bug with title argument being added to WP_Query() in 4.4
1393
  'title',
1394
  'content',
1395
  'readmore',
1396
+ 'button_class',
1397
 
1398
  'size',
1399
 
1406
  'desktop_height',
1407
  'laptop_height',
1408
  'mobile_height',
 
1409
  );
1410
 
1411
  $display = array();
1420
  $display['layout'] = 'bxslider';
1421
  }
1422
 
1423
+ $valid_templates = array( 'slider1', 'slider2' );
1424
  if ( ! in_array( $display['template'], $valid_templates ) ) {
1425
+ $display['template'] = 'slider1';
1426
  }
1427
 
1428
  // clean input values
1449
  $display['heading_size'] = (int) $display['heading_size'];
1450
  $display['mobile_heading_size'] = (int) $display['mobile_heading_size'];
1451
 
1452
+ $display['button_class'] = trim( $display['button_class'] );
1453
+ $display['button_class'] = empty( $display['button_class'] ) ? 'wc-shortcodes-post-slide-button' : $display['button_class'];
1454
+
1455
 
1456
  // add tax query if user specified
1457
  if ( ! empty( $wpc_term ) ) {
1477
  $valid_headings = array( 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' );
1478
  $display['heading_type'] = in_array( $display['heading_type'], $valid_headings ) ? $display['heading_type'] : 'h2';
1479
 
1480
+ ($display['meta_category'] == "yes") ? ($display['meta_category'] = true) : ($display['meta_category'] = false);
1481
  ($display['title'] == "yes") ? ($display['title'] = true) : ($display['title'] = false);
1482
  ($display['content'] == "yes") ? ($display['content'] = true) : ($display['content'] = false);
1483
  ($atts['order'] == "ASC") ? ($atts['order'] = "ASC") : ($atts['order'] = "DESC");
1522
  $class[] = 'wc-shortcodes-posts-layout-' . $display['layout'];
1523
  $class[] = 'wc-shortcodes-posts-template-' . $display['template'];
1524
 
1525
+ $html .= '<div id="" class="wc-shortcodes-post-slider-wrapper">';
1526
  $html .= '<div id="wc-shortcodes-post-slider-'.$instance.'" class="' . implode( ' ', $class ) . '">';
1527
 
1528
  while( $wc_shortcodes_posts_query->have_posts() ) :
includes/templates/{slider → slider1}/content.php RENAMED
@@ -29,7 +29,7 @@
29
 
30
  <?php if ( $display['readmore'] ) : ?>
31
  <div class="wc-shortcodes-read-more">
32
- <a class="wc-shortcodes-post-slide-button" href="<?php the_permalink(); ?>"><?php echo $display['readmore']; ?></a>
33
  </div><!-- .entry-summary -->
34
  <?php endif; ?>
35
  </div>
29
 
30
  <?php if ( $display['readmore'] ) : ?>
31
  <div class="wc-shortcodes-read-more">
32
+ <a class="<?php echo $display['button_class']; ?>" href="<?php the_permalink(); ?>"><?php echo $display['readmore']; ?></a>
33
  </div><!-- .entry-summary -->
34
  <?php endif; ?>
35
  </div>
includes/templates/{slider → slider1}/index.php RENAMED
File without changes
includes/templates/slider2/content.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $classes[] = 'wc-shortcodes-post-slide'; ?>
2
+ <?php $image_style = ''; ?>
3
+ <?php if ( has_post_thumbnail() && ! post_password_required() ) : ?>
4
+ <?php $image_style = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), $display['size'] ); ?></a>
5
+ <?php $image_style = 'background-image:url(\''.$image_style[0].'\');'; ?>
6
+ <?php endif; ?>
7
+ <div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?> style="<?php echo $image_style; ?>">
8
+ <div class="wc-shortcodes-post-slide-border">
9
+
10
+ <div class="wc-shortcodes-post-slide-content">
11
+ <div class="wc-shortcodes-post-slide-content-inner">
12
+ <?php if ( $display['meta_category'] ) : ?>
13
+ <?php echo wc_shortcodes_get_posted_category(); ?>
14
+ <?php endif; ?>
15
+
16
+ <?php if ( $display['title'] ) : ?>
17
+ <div class="wc-shortcodes-entry-header">
18
+ <<?php echo $display['heading_type']; ?> class="wc-shortcodes-entry-title">
19
+ <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
20
+ </<?php echo $display['heading_type']; ?>>
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_excerpt(); ?>
27
+ </div><!-- .entry-summary -->
28
+ <?php endif; ?>
29
+
30
+ <?php if ( $display['readmore'] ) : ?>
31
+ <div class="wc-shortcodes-read-more">
32
+ <a class="<?php echo $display['button_class']; ?>" href="<?php the_permalink(); ?>"><?php echo $display['readmore']; ?></a>
33
+ </div><!-- .entry-summary -->
34
+ <?php endif; ?>
35
+ </div>
36
+ </div><!-- .wc-shortcodes-post-content -->
37
+ </div><!-- .wc-shortcodes-post-border -->
38
+ </div><!-- #post -->
includes/templates/slider2/index.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $blog_use_excerpt = true;
3
+ $post_format = get_post_format();
4
+ if ( $blog_use_excerpt ) {
5
+ if ( empty( $post_format ) ) {
6
+ $post_format = 'excerpt';
7
+ }
8
+ }
9
+
10
+ $classes = wc_shortcodes_display_term_classes( $atts['taxonomy'] );
11
+
12
+ switch( $post_format ) {
13
+ /* case 'excerpt' :
14
+ include( 'content-excerpt.php' );
15
+ break;
16
+ case 'aside' :
17
+ include( 'content-aside.php' );
18
+ break;
19
+ case 'link' :
20
+ include( 'content-link.php' );
21
+ break;
22
+ case 'chat' :
23
+ include( 'content-chat.php' );
24
+ break;
25
+ case 'audio' :
26
+ include( 'content-audio.php' );
27
+ break;
28
+ case 'video' :
29
+ include( 'content-video.php' );
30
+ break;
31
+ case 'quote' :
32
+ include( 'content-quote.php' );
33
+ break;
34
+ case 'gallery' :
35
+ include( 'content-gallery.php' );
36
+ break; */
37
+ default :
38
+ include( 'content.php' );
39
+ }
40
+ ?>
includes/vendors/wpc-settings-framework/class-wpc-settings-framework.php CHANGED
@@ -17,7 +17,7 @@
17
  */
18
  class WC_Shortcodes_Settings_Framework {
19
 
20
- protected $version = '1.0.0';
21
 
22
  /**
23
  * Instance of this class.
@@ -52,6 +52,7 @@ class WC_Shortcodes_Settings_Framework {
52
  protected $plugin_prefix = null;
53
  protected $plugin_version = 0;
54
  protected $options = array();
 
55
  protected $wp_settings_tabs = array();
56
  protected $tabs = array();
57
 
@@ -71,6 +72,8 @@ class WC_Shortcodes_Settings_Framework {
71
  add_action( 'init', array( $this, 'set_options' ), 100 );
72
  add_action( 'admin_init', array( $this, 'register_settings' ) );
73
  add_action( 'admin_init', array( $this, 'options_activation' ), 200 );
 
 
74
  add_action( 'admin_menu', array( $this, 'options_admin_menu' ) );
75
 
76
  // Load admin style sheet and JavaScript.
@@ -118,22 +121,13 @@ class WC_Shortcodes_Settings_Framework {
118
 
119
  public function set_options() {
120
  $this->options = apply_filters ( $this->plugin_prefix . 'wpcsf_options' , $this->options );
 
121
  }
122
 
123
- public function options_activation() {
124
-
125
- $initialize = false;
126
-
127
- if ( ! isset( $this->plugin_current_version ) || empty( $this->plugin_current_version ) ) {
128
- $initialize = true;
129
- }
130
- else if ( version_compare( $this->plugin_version, $this->plugin_current_version ) > 0 ) {
131
- $initialize = true;
132
- }
133
-
134
- if ( $initialize ) {
135
- update_option( $this->plugin_prefix . 'current_version', $this->plugin_version );
136
 
 
137
  foreach ( $this->options as $menu_slug => $o ) {
138
  if ( isset( $o['option_group'] ) ) {
139
  if ( isset( $o['tabs'] ) &&
@@ -141,18 +135,91 @@ class WC_Shortcodes_Settings_Framework {
141
  foreach( $o['tabs'] as $key => $oo ) {
142
  if ( isset( $oo['sections'] ) &&
143
  is_array( $oo['sections'] ) ) {
144
- $this->loop_and_init_options( $oo['sections'] );
145
  }
146
  }
147
  }
148
  else if ( isset( $o['sections'] ) &&
149
  is_array( $o['sections'] ) ) {
150
- $this->loop_and_init_options( $o['sections'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  }
152
  }
153
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  }
155
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156
 
157
  public function loop_and_init_options( $sections ) {
158
  foreach( $sections as $o ) {
17
  */
18
  class WC_Shortcodes_Settings_Framework {
19
 
20
+ protected $version = '1.0.2';
21
 
22
  /**
23
  * Instance of this class.
52
  protected $plugin_prefix = null;
53
  protected $plugin_version = 0;
54
  protected $options = array();
55
+ protected $theme_support = array();
56
  protected $wp_settings_tabs = array();
57
  protected $tabs = array();
58
 
72
  add_action( 'init', array( $this, 'set_options' ), 100 );
73
  add_action( 'admin_init', array( $this, 'register_settings' ) );
74
  add_action( 'admin_init', array( $this, 'options_activation' ), 200 );
75
+ // add_action( 'admin_init', array( $this, 'update_options' ), 200 ); // debug
76
+ add_action( 'after_switch_theme', array( $this, 'update_options' ), 200 );
77
  add_action( 'admin_menu', array( $this, 'options_admin_menu' ) );
78
 
79
  // Load admin style sheet and JavaScript.
121
 
122
  public function set_options() {
123
  $this->options = apply_filters ( $this->plugin_prefix . 'wpcsf_options' , $this->options );
124
+ $this->theme_support = apply_filters ( $this->plugin_prefix . 'wpcsf_theme_support' , $this->theme_support );
125
  }
126
 
127
+ public function update_options() {
128
+ $this->set_options();
 
 
 
 
 
 
 
 
 
 
 
129
 
130
+ if ( isset( $this->theme_support['theme_reset'] ) && $this->theme_support['theme_reset'] ) {
131
  foreach ( $this->options as $menu_slug => $o ) {
132
  if ( isset( $o['option_group'] ) ) {
133
  if ( isset( $o['tabs'] ) &&
135
  foreach( $o['tabs'] as $key => $oo ) {
136
  if ( isset( $oo['sections'] ) &&
137
  is_array( $oo['sections'] ) ) {
138
+ $this->loop_and_update_options( $oo['sections'] );
139
  }
140
  }
141
  }
142
  else if ( isset( $o['sections'] ) &&
143
  is_array( $o['sections'] ) ) {
144
+ $this->loop_and_update_options( $o['sections'] );
145
+ }
146
+ }
147
+ }
148
+ }
149
+
150
+ }
151
+
152
+ public function loop_and_update_options( $sections ) {
153
+ foreach( $sections as $o ) {
154
+ if ( isset( $o['id'] ) &&
155
+ isset( $o['title'] ) &&
156
+ isset( $o['options'] ) &&
157
+ is_array( $o['options'] ) ) {
158
+ foreach( $o['options'] as $oo ) {
159
+ if ( isset( $oo['group'] ) && is_array( $oo['group'] ) ) {
160
+ foreach ( $oo['group'] as $key => $ooo ) {
161
+ if ( isset( $ooo['option_name'] ) ) {
162
+ if ( isset( $ooo['theme_reset'] ) && $ooo['theme_reset'] ) {
163
+ $ooo['option_name'] = $this->plugin_prefix . $ooo['option_name'];
164
+ $this->update_option( $ooo['option_name'], $ooo['default'] );
165
+ }
166
+ }
167
+ }
168
+ }
169
+ else {
170
+ if ( isset( $oo['option_name'] ) ) {
171
+ if ( isset( $oo['theme_reset'] ) && $oo['theme_reset'] ) {
172
+ $oo['option_name'] = $this->plugin_prefix . $oo['option_name'];
173
+ $this->update_option( $oo['option_name'], $oo['default'] );
174
+ }
175
+ }
176
  }
177
  }
178
  }
179
+ }
180
+ }
181
+
182
+ public function update_option( $option_name, $default ) {
183
+ update_option( $option_name, $default );
184
+ }
185
+
186
+ public function options_activation() {
187
+
188
+ $initialize = false;
189
+
190
+ if ( ! isset( $this->plugin_current_version ) || empty( $this->plugin_current_version ) ) {
191
+ $initialize = true;
192
+ }
193
+ else if ( version_compare( $this->plugin_version, $this->plugin_current_version ) > 0 ) {
194
+ $initialize = true;
195
+ }
196
+
197
+ if ( $initialize ) {
198
+ $this->options_activation_loop();
199
  }
200
  }
201
+
202
+ public function options_activation_loop() {
203
+ update_option( $this->plugin_prefix . 'current_version', $this->plugin_version );
204
+
205
+ foreach ( $this->options as $menu_slug => $o ) {
206
+ if ( isset( $o['option_group'] ) ) {
207
+ if ( isset( $o['tabs'] ) &&
208
+ is_array( $o['tabs'] ) ) {
209
+ foreach( $o['tabs'] as $key => $oo ) {
210
+ if ( isset( $oo['sections'] ) &&
211
+ is_array( $oo['sections'] ) ) {
212
+ $this->loop_and_init_options( $oo['sections'] );
213
+ }
214
+ }
215
+ }
216
+ else if ( isset( $o['sections'] ) &&
217
+ is_array( $o['sections'] ) ) {
218
+ $this->loop_and_init_options( $o['sections'] );
219
+ }
220
+ }
221
+ }
222
+ }
223
 
224
  public function loop_and_init_options( $sections ) {
225
  foreach( $sections as $o ) {
readme.txt CHANGED
@@ -88,6 +88,12 @@ Use the shortcode manager in the TinyMCE text editor
88
 
89
  == Changelog ==
90
 
 
 
 
 
 
 
91
  = Version 1.94 =
92
 
93
  * Added post_slider shortcode
88
 
89
  == Changelog ==
90
 
91
+ = Version 1.95 =
92
+
93
+ * settings framework 1.0.2
94
+ * theme reset option when supported themes are activated
95
+ * Updated post slider function and style
96
+
97
  = Version 1.94 =
98
 
99
  * Added post_slider shortcode
wc-shortcodes.php CHANGED
@@ -5,11 +5,11 @@ 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: 1.94
9
  License: GPLv2 or later
10
  */
11
 
12
- define( 'WC_SHORTCODES_VERSION', '1.94' );
13
  define( 'WC_SHORTCODES_PREFIX', 'wc_shortcodes_' );
14
  define( '_WC_SHORTCODES_PREFIX', '_wc_shortcodes_' );
15
  define( 'WC_SHORTCODES_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
@@ -49,6 +49,7 @@ $wc_shortcodes_share_buttons = array(
49
  'print' => 'Print',
50
  );
51
  $wc_shortcodes_theme_support = array(
 
52
  'fullwidth_container' => '#main',
53
  'social_icons_format' => 'image',
54
  'share_buttons_filter_disable' => false,
5
  Description: A family of shortcodes to enhance site functionality.
6
  Author: Chris Baldelomar
7
  Author URI: http://webplantmedia.com/
8
+ Version: 1.95
9
  License: GPLv2 or later
10
  */
11
 
12
+ define( 'WC_SHORTCODES_VERSION', '1.95' );
13
  define( 'WC_SHORTCODES_PREFIX', 'wc_shortcodes_' );
14
  define( '_WC_SHORTCODES_PREFIX', '_wc_shortcodes_' );
15
  define( 'WC_SHORTCODES_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
49
  'print' => 'Print',
50
  );
51
  $wc_shortcodes_theme_support = array(
52
+ 'theme_reset' => false,
53
  'fullwidth_container' => '#main',
54
  'social_icons_format' => 'image',
55
  'share_buttons_filter_disable' => false,