Shortcodes by Angie Makes - Version 3.23

Version Description

Download this release

Release Info

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

Code changes from version 3.22 to 3.23

README.md CHANGED
@@ -106,6 +106,10 @@ See our help article on [how to manually upload a plugin](http://knowledgebase.a
106
 
107
  ## Changelog ##
108
 
 
 
 
 
109
  ### Version 3.22 ###
110
 
111
  * fixed format class name in social icons and share icons
106
 
107
  ## Changelog ##
108
 
109
+ ### Version 3.23 ###
110
+
111
+ * added attributes for fullwidth shortcoded
112
+
113
  ### Version 3.22 ###
114
 
115
  * fixed format class name in social icons and share icons
public/assets/css/style.css CHANGED
@@ -2025,3 +2025,15 @@ pre.pre-wrap {
2025
  .wc-shortcodes-full-width {
2026
  visibility: hidden;
2027
  }
 
 
 
 
 
 
 
 
 
 
 
 
2025
  .wc-shortcodes-full-width {
2026
  visibility: hidden;
2027
  }
2028
+ .wc-shortcodes-full-width-inner {
2029
+ margin: 0 auto;
2030
+ }
2031
+ .wc-shortcodes-full-width-has-border-color {
2032
+ border-top: 1px solid #cccccc;
2033
+ border-bottom: 1px solid #cccccc;
2034
+ }
2035
+ .wc-shortcodes-full-width-style-frame {
2036
+ padding-top: 10px;
2037
+ padding-bottom: 10px;
2038
+ background-color: #ffffff;
2039
+ }
public/class-register.php CHANGED
@@ -109,9 +109,84 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
109
  $atts['selector'] = parent::$theme_support[ 'fullwidth_container' ];
110
  }
111
 
 
 
 
 
 
112
  wp_enqueue_script('wc-shortcodes-fullwidth');
113
 
114
- return '<div class="wc-shortcodes-full-width wc-shortcodes-content" data-selector="' . esc_attr( $atts['selector'] ) . '">' . do_shortcode( $content ) . '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  }
116
 
117
 
@@ -779,10 +854,10 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
779
  if ( $atts['color'] ) {
780
  $style_attr .= 'color: '. $atts['color'] .';';
781
  }
782
- if( $atts['margin_bottom'] ) {
783
  $style_attr .= 'margin-bottom: '. $atts['margin_bottom'] .';';
784
  }
785
- if ( $atts['margin_top'] ) {
786
  $style_attr .= 'margin-top: '. $atts['margin_top'] .';';
787
  }
788
 
109
  $atts['selector'] = parent::$theme_support[ 'fullwidth_container' ];
110
  }
111
 
112
+ $style = array();
113
+ $wrapper_style = array();
114
+ $frame_style = array();
115
+ $class = array();
116
+
117
  wp_enqueue_script('wc-shortcodes-fullwidth');
118
 
119
+ // Append style and class names
120
+ if ( ! empty( $atts['max_width'] ) ) {
121
+ $style[] = 'max-width:' . $atts['max_width'];
122
+ }
123
+ if ( ! empty( $atts['padding_top'] ) ) {
124
+ $style[] = 'padding-top:' . $atts['padding_top'];
125
+ }
126
+ if ( ! empty( $atts['padding_bottom'] ) ) {
127
+ $style[] = 'padding-bottom:' . $atts['padding_bottom'];
128
+ }
129
+ if ( ! empty( $atts['padding_side'] ) ) {
130
+ $style[] = 'padding-left:' . $atts['padding_side'];
131
+ $style[] = 'padding-right:' . $atts['padding_side'];
132
+ $class[] = 'wc-shortcodes-full-width-has-side-padding';
133
+ }
134
+ if ( ! empty( $atts['style'] ) ) {
135
+ $class[] = 'wc-shortcodes-full-width-style-' . $atts['style'];
136
+ }
137
+ if ( ! empty( $atts['class'] ) ) {
138
+ $class[] = $atts['class'];
139
+ }
140
+
141
+ // Insert Element
142
+ if ( ! empty( $style ) ) {
143
+ $style = implode( ';', $style );
144
+ $content = '<div class="wc-shortcodes-full-width-inner" style="' . $style . '">' . $content . '</div>';
145
+ }
146
+
147
+ // Wrapper and Frame Style
148
+ if ( ! empty( $atts['background_color'] ) ) {
149
+ if ( 'frame' == $atts['style'] ) {
150
+ $frame_style[] = 'background-color:' . $atts['background_color'];
151
+ }
152
+ else {
153
+ $wrapper_style[] = 'background-color:' . $atts['background_color'];
154
+ }
155
+ }
156
+ if ( ! empty( $atts['border_color'] ) ) {
157
+ $wrapper_style[] = 'border-color:' . $atts['border_color'];
158
+ $class[] = 'wc-shortcodes-full-width-has-border-color';
159
+ }
160
+
161
+ if ( ! empty( $wrapper_style ) ) {
162
+ $wrapper_style = ' style="' . implode( ';', $wrapper_style ) . '"';
163
+ }
164
+ else {
165
+ $wrapper_style = '';
166
+ }
167
+
168
+ if ( ! empty( $frame_style ) ) {
169
+ $frame_style = ' style="' . implode( ';', $frame_style ) . '"';
170
+ }
171
+ else {
172
+ $frame_style = '';
173
+ }
174
+
175
+ // Insert Frame Element If Called
176
+ if ( ! empty( $frame_style ) ) {
177
+ $content = '<div class="wc-shortcodes-full-width-frame"' . $frame_style . '>' . $content . '</div>';
178
+ }
179
+
180
+ // Wrapper Class
181
+ if ( ! empty( $class ) ) {
182
+ $class = ' ' . implode( ' ', $class );
183
+ }
184
+ else {
185
+ $class = '';
186
+ }
187
+
188
+ // Return HTML
189
+ return '<div class="wc-shortcodes-full-width wc-shortcodes-content' . esc_attr( $class ) . '"' . $wrapper_style . ' data-selector="' . esc_attr( $atts['selector'] ) . '">' . do_shortcode( $content ) . '</div>';
190
  }
191
 
192
 
854
  if ( $atts['color'] ) {
855
  $style_attr .= 'color: '. $atts['color'] .';';
856
  }
857
+ if( '' != $atts['margin_bottom'] ) {
858
  $style_attr .= 'margin-bottom: '. $atts['margin_bottom'] .';';
859
  }
860
+ if ( '' != $atts['margin_top'] ) {
861
  $style_attr .= 'margin-top: '. $atts['margin_top'] .';';
862
  }
863
 
public/class-sanitize.php CHANGED
@@ -229,6 +229,15 @@ class WPC_Shortcodes_Sanitize {
229
  return $default;
230
  }
231
 
 
 
 
 
 
 
 
 
 
232
  public static function google_map_zoom( $value, $default = 8 ) {
233
  $whitelist = WPC_Shortcodes_Widget_Options::google_map_zoom_values();
234
 
@@ -955,6 +964,30 @@ class WPC_Shortcodes_Sanitize {
955
  case 'selector' :
956
  $atts[ $key ] = sanitize_text_field( $value );
957
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
958
  }
959
  }
960
 
229
  return $default;
230
  }
231
 
232
+ public static function fullwidth_style( $value, $default = 'solid' ) {
233
+ $whitelist = WPC_Shortcodes_Widget_Options::fullwidth_style_values();
234
+
235
+ if ( array_key_exists( $value, $whitelist ) )
236
+ return $value;
237
+
238
+ return $default;
239
+ }
240
+
241
  public static function google_map_zoom( $value, $default = 8 ) {
242
  $whitelist = WPC_Shortcodes_Widget_Options::google_map_zoom_values();
243
 
964
  case 'selector' :
965
  $atts[ $key ] = sanitize_text_field( $value );
966
  break;
967
+ case 'max_width' :
968
+ $atts[ $key ] = self::css_unit( $value );
969
+ break;
970
+ case 'class' :
971
+ $atts[ $key ] = self::html_classes( $value );
972
+ break;
973
+ case 'padding_top' :
974
+ $atts[ $key ] = self::css_unit( $value );
975
+ break;
976
+ case 'padding_bottom' :
977
+ $atts[ $key ] = self::css_unit( $value );
978
+ break;
979
+ case 'padding_side' :
980
+ $atts[ $key ] = self::css_unit( $value );
981
+ break;
982
+ case 'background_color' :
983
+ $atts[ $key ] = self::hex_color( $value );
984
+ break;
985
+ case 'border_color' :
986
+ $atts[ $key ] = self::hex_color( $value );
987
+ break;
988
+ case 'style' :
989
+ $atts[ $key ] = self::fullwidth_style( $value );
990
+ break;
991
  }
992
  }
993
 
public/class-vars.php CHANGED
@@ -8,7 +8,7 @@ class WPC_Shortcodes_Vars {
8
  *
9
  * @var string
10
  */
11
- const VERSION = '3.22';
12
  const DB_VERSION = '1.0';
13
 
14
  /**
@@ -249,6 +249,14 @@ class WPC_Shortcodes_Vars {
249
  );
250
  self::$attr->fullwidth = array(
251
  'selector' => self::$theme_support[ 'fullwidth_container' ],
 
 
 
 
 
 
 
 
252
  );
253
  self::$attr->pricing = array(
254
  'type' => 'primary', // primary, secondary, inverse
8
  *
9
  * @var string
10
  */
11
+ const VERSION = '3.23';
12
  const DB_VERSION = '1.0';
13
 
14
  /**
249
  );
250
  self::$attr->fullwidth = array(
251
  'selector' => self::$theme_support[ 'fullwidth_container' ],
252
+ 'max_width' => '',
253
+ 'padding_top' => '',
254
+ 'padding_bottom' => '',
255
+ 'padding_side' => '',
256
+ 'background_color' => '',
257
+ 'border_color' => '',
258
+ 'style' => '',
259
+ 'class' => '',
260
  );
261
  self::$attr->pricing = array(
262
  'type' => 'primary', // primary, secondary, inverse
public/class-widget-options.php CHANGED
@@ -156,6 +156,13 @@ class WPC_Shortcodes_Widget_Options {
156
  );
157
  }
158
 
 
 
 
 
 
 
 
159
  public static function divider_line_values() {
160
  return array(
161
  '' => 'None',
156
  );
157
  }
158
 
159
+ public static function fullwidth_style_values() {
160
+ return array(
161
+ '' => 'Box',
162
+ 'frame' => 'Frame',
163
+ );
164
+ }
165
+
166
  public static function divider_line_values() {
167
  return array(
168
  '' => 'None',
public/widgets/widget-fullwidth.php CHANGED
@@ -20,7 +20,57 @@ class WPC_Shortcodes_Widget_FullWidth extends WPC_Shortcodes_Widget_Base {
20
  <input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('selector'); ?>" name="<?php echo $this->get_field_name('selector'); ?>" value="<?php echo $o['selector']; ?>" />
21
  <span class="wcs-description">Enter the name of the selector of the outer container element you want your content to span full width to.<br /><br />Example: <code>#main</code>, <code>.site-content</code>, <code>body</code>.<br /><br />Leave blank to use default selector <code><?php echo WPC_Shortcodes_Vars::$theme_support[ 'fullwidth_container' ]; ?></code></span>
22
  </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  </div>
 
 
 
 
 
 
 
 
24
  <?php
25
  }
26
  }
20
  <input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('selector'); ?>" name="<?php echo $this->get_field_name('selector'); ?>" value="<?php echo $o['selector']; ?>" />
21
  <span class="wcs-description">Enter the name of the selector of the outer container element you want your content to span full width to.<br /><br />Example: <code>#main</code>, <code>.site-content</code>, <code>body</code>.<br /><br />Leave blank to use default selector <code><?php echo WPC_Shortcodes_Vars::$theme_support[ 'fullwidth_container' ]; ?></code></span>
22
  </p>
23
+ <p>
24
+ <label for="<?php echo $this->get_field_id('class'); ?>"><?php _e('Class:') ?></label>
25
+ <input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('class'); ?>" name="<?php echo $this->get_field_name('class'); ?>" value="<?php echo $o['class']; ?>" />
26
+ <span class="wcs-description">Enter class name for custom CSS styling.</span>
27
+ </p>
28
+ <p>
29
+ <label for="<?php echo $this->get_field_id('style'); ?>"><?php _e('Style Type:'); ?></label>
30
+ <select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('style'); ?>" name="<?php echo $this->get_field_name('style'); ?>">
31
+ <?php foreach ( WPC_Shortcodes_Widget_Options::fullwidth_style_values() as $key => $value ) : ?>
32
+ <option value="<?php echo $key; ?>"<?php selected( $o['style'], $key ); ?>><?php echo $value; ?></option>';
33
+ <?php endforeach; ?>
34
+ </select>
35
+ </p>
36
+ <p>
37
+ <label for="<?php echo $this->get_field_id('background_color'); ?>"><?php _e('Background Color:') ?></label><br />
38
+ <input type="text" class="wc-shortcodes-widget-option widefat wc-shortcodes-widget-color-picker" id="<?php echo $this->get_field_id('background_color'); ?>" name="<?php echo $this->get_field_name('background_color'); ?>" value="<?php echo $o['background_color']; ?>" />
39
+ </p>
40
+ <p>
41
+ <label for="<?php echo $this->get_field_id('border_color'); ?>"><?php _e('Border Color:') ?></label><br />
42
+ <input type="text" class="wc-shortcodes-widget-option widefat wc-shortcodes-widget-color-picker" id="<?php echo $this->get_field_id('border_color'); ?>" name="<?php echo $this->get_field_name('border_color'); ?>" value="<?php echo $o['border_color']; ?>" />
43
+ </p>
44
+ <h2>Inner Content Settings</h2>
45
+ <p>
46
+ <label for="<?php echo $this->get_field_id('max_width'); ?>"><?php _e('Max Width For Inner Content:') ?></label>
47
+ <input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('max_width'); ?>" name="<?php echo $this->get_field_name('max_width'); ?>" value="<?php echo $o['max_width']; ?>" />
48
+ <span class="wcs-description">Enter CSS unit value. Leave blank if you want the content to span the full width.</span>
49
+ </p>
50
+ <p>
51
+ <label for="<?php echo $this->get_field_id('padding_top'); ?>"><?php _e('Top Padding:') ?></label>
52
+ <input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('padding_top'); ?>" name="<?php echo $this->get_field_name('padding_top'); ?>" value="<?php echo $o['padding_top']; ?>" />
53
+ <span class="wcs-description">Enter CSS unit value.</span>
54
+ </p>
55
+ <p>
56
+ <label for="<?php echo $this->get_field_id('padding_bottom'); ?>"><?php _e('Bottom Padding:') ?></label>
57
+ <input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('padding_bottom'); ?>" name="<?php echo $this->get_field_name('padding_bottom'); ?>" value="<?php echo $o['padding_bottom']; ?>" />
58
+ <span class="wcs-description">Enter CSS unit value.</span>
59
+ </p>
60
+ <p>
61
+ <label for="<?php echo $this->get_field_id('padding_side'); ?>"><?php _e('Side Padding:') ?></label>
62
+ <input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('padding_side'); ?>" name="<?php echo $this->get_field_name('padding_side'); ?>" value="<?php echo $o['padding_side']; ?>" />
63
+ <span class="wcs-description">Enter CSS unit value.</span>
64
+ </p>
65
  </div>
66
+
67
+ <script type="text/javascript">
68
+ /* <![CDATA[ */
69
+ jQuery(document).ready(function($){
70
+ $('#wc-shortcodes-fullwidth-widget-<?php echo $this->number; ?>').wcColorPickerWidget();
71
+ });
72
+ /* ]]> */
73
+ </script>
74
  <?php
75
  }
76
  }
readme.txt CHANGED
@@ -113,6 +113,10 @@ See our help article on [how to manually upload a plugin](http://knowledgebase.a
113
 
114
  == Changelog ==
115
 
 
 
 
 
116
  = Version 3.22 =
117
 
118
  * fixed format class name in social icons and share icons
113
 
114
  == Changelog ==
115
 
116
+ = Version 3.23 =
117
+
118
+ * added attributes for fullwidth shortcoded
119
+
120
  = Version 3.22 =
121
 
122
  * fixed format class name in social icons and share icons
wc-shortcodes.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://angiemakes.com/feminine-wordpress-blog-themes-women/
5
  Description: A plugin that adds a useful family of shortcodes to your WordPress theme.
6
  Author: Chris Baldelomar
7
  Author URI: http://angiemakes.com/
8
- Version: 3.22
9
  License: GPLv2 or later
10
  */
11
 
5
  Description: A plugin that adds a useful family of shortcodes to your WordPress theme.
6
  Author: Chris Baldelomar
7
  Author URI: http://angiemakes.com/
8
+ Version: 3.23
9
  License: GPLv2 or later
10
  */
11