Shortcodes by Angie Makes - Version 1.42

Version Description

Download this release

Release Info

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

Code changes from version 1.40 to 1.42

Files changed (5) hide show
  1. README.md +4 -0
  2. includes/css/style.css +45 -0
  3. includes/widgets.php +47 -19
  4. readme.txt +4 -0
  5. wc-shortcodes.php +2 -2
README.md CHANGED
@@ -66,6 +66,10 @@ Use the shortcode manager in the TinyMCE text editor
66
 
67
  ## Changelog ##
68
 
 
 
 
 
69
  ### Version 1.40
70
 
71
  * Fixed bug with Shortcode menu button hiding when latest WooCommerce plugin was installed.
66
 
67
  ## Changelog ##
68
 
69
+ ### Version 1.42
70
+
71
+ * Improved social icons widget
72
+
73
  ### Version 1.40
74
 
75
  * Fixed bug with Shortcode menu button hiding when latest WooCommerce plugin was installed.
includes/css/style.css CHANGED
@@ -1049,6 +1049,12 @@ pre.pre-wrap {
1049
  .widget_wc_shortcodes_social_icons .wc-shortcodes-social-icons {
1050
  text-align: center;
1051
  }
 
 
 
 
 
 
1052
  .widget_wc_shortcodes_social_icons .wc-shortcodes-social-icons li {
1053
  display: inline-block;
1054
  padding: 3px;
@@ -1057,6 +1063,14 @@ pre.pre-wrap {
1057
  -moz-box-sizing: border-box;
1058
  box-sizing: border-box;
1059
  }
 
 
 
 
 
 
 
 
1060
  .widget_wc_shortcodes_social_icons .wc-shortcodes-social-icons.wc-shortcodes-columns-8 li {
1061
  width: 12.5%;
1062
  }
@@ -1081,6 +1095,37 @@ pre.pre-wrap {
1081
  .widget_wc_shortcodes_social_icons .wc-shortcodes-social-icons.wc-shortcodes-columns-1 li {
1082
  width: 100%;
1083
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1084
 
1085
 
1086
  /**
1049
  .widget_wc_shortcodes_social_icons .wc-shortcodes-social-icons {
1050
  text-align: center;
1051
  }
1052
+ .wc-shortcodes-social-icons.wc-shortcodes-columns-float-left {
1053
+ text-align: left;
1054
+ }
1055
+ .wc-shortcodes-social-icons.wc-shortcodes-columns-float-right {
1056
+ text-align: right;
1057
+ }
1058
  .widget_wc_shortcodes_social_icons .wc-shortcodes-social-icons li {
1059
  display: inline-block;
1060
  padding: 3px;
1063
  -moz-box-sizing: border-box;
1064
  box-sizing: border-box;
1065
  }
1066
+ .widget_wc_shortcodes_social_icons .wc-shortcodes-social-icons.wc-shortcodes-columns-float-left li {
1067
+ padding-right: 6px;
1068
+ padding-left: 0;
1069
+ }
1070
+ .widget_wc_shortcodes_social_icons .wc-shortcodes-social-icons.wc-shortcodes-columns-float-right li {
1071
+ padding-right: 0;
1072
+ padding-left: 6px;
1073
+ }
1074
  .widget_wc_shortcodes_social_icons .wc-shortcodes-social-icons.wc-shortcodes-columns-8 li {
1075
  width: 12.5%;
1076
  }
1095
  .widget_wc_shortcodes_social_icons .wc-shortcodes-social-icons.wc-shortcodes-columns-1 li {
1096
  width: 100%;
1097
  }
1098
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-10 img { max-height: 10px; }
1099
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-12 img { max-height: 12px; }
1100
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-14 img { max-height: 14px; }
1101
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-16 img { max-height: 16px; }
1102
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-18 img { max-height: 18px; }
1103
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-20 img { max-height: 20px; }
1104
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-22 img { max-height: 22px; }
1105
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-24 img { max-height: 24px; }
1106
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-26 img { max-height: 26px; }
1107
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-28 img { max-height: 28px; }
1108
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-30 img { max-height: 30px; }
1109
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-32 img { max-height: 32px; }
1110
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-34 img { max-height: 34px; }
1111
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-36 img { max-height: 36px; }
1112
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-38 img { max-height: 38px; }
1113
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-40 img { max-height: 40px; }
1114
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-42 img { max-height: 42px; }
1115
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-44 img { max-height: 44px; }
1116
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-46 img { max-height: 46px; }
1117
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-48 img { max-height: 48px; }
1118
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-50 img { max-height: 50px; }
1119
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-52 img { max-height: 52px; }
1120
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-54 img { max-height: 54px; }
1121
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-56 img { max-height: 56px; }
1122
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-58 img { max-height: 58px; }
1123
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-60 img { max-height: 60px; }
1124
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-62 img { max-height: 62px; }
1125
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-64 img { max-height: 64px; }
1126
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-66 img { max-height: 66px; }
1127
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-68 img { max-height: 68px; }
1128
+ .wc-shortcodes-social-icons.wc-shortcodes-maxheight-70 img { max-height: 70px; }
1129
 
1130
 
1131
  /**
includes/widgets.php CHANGED
@@ -36,25 +36,39 @@ class WC_Shortcodes_Social_Icons_Widget extends WP_Widget {
36
  echo $args['before_title'] . $instance['title'] . $args['after_title'];
37
 
38
  // set class with the number of columns the user selected
39
- $columns = (int) $instance['columns'];
40
  if ( empty($columns) ) {
41
- $columns = 3;
 
 
 
 
42
  }
43
 
44
  $order = $instance['order'];
45
  $first = true;
46
 
47
- $class = ' wc-shortcodes-columns-'.$columns;
 
 
 
 
 
 
 
 
 
48
 
49
- $html = '<ul class="wc-shortcodes-social-icons wc-shortcodes-clearfix'.$class.'">';
50
  $i = 0;
51
  foreach ($order as $key => $name) {
52
  $li_class = array();
53
  $li_class[] = 'wc-shortcodes-social-icon';
54
  $li_class[] = 'wc-shortcode-social-icon-' . $key;
55
 
56
- if ( $i % $columns == 0 )
57
  $li_class[] = 'clear-left';
 
58
 
59
  $link_option_name = WC_SHORTCODES_PREFIX . $key . '_link';
60
  $icon_option_name = WC_SHORTCODES_PREFIX . $key . '_icon';
@@ -87,7 +101,8 @@ class WC_Shortcodes_Social_Icons_Widget extends WP_Widget {
87
 
88
  function update( $new_instance, $old_instance ) {
89
  $instance['title'] = strip_tags( stripslashes($new_instance['title']) );
90
- $instance['columns'] = (int) $new_instance['columns'];
 
91
  $instance['order'] = $new_instance['order'];
92
  return $instance;
93
  }
@@ -111,8 +126,13 @@ class WC_Shortcodes_Social_Icons_Widget extends WP_Widget {
111
  );
112
  $order = isset( $instance['order'] ) ? $instance['order'] : $default_order;
113
  $title = isset( $instance['title'] ) ? $instance['title'] : 'Follow Me!';
114
- $columns = isset( $instance['columns'] ) ? (int) $instance['columns'] : 6;
 
115
  ?>
 
 
 
 
116
  <label><?php _e('Order:'); ?></label>
117
  <ul class="wc-shortcodes-clearfix wc-shortcodes-social-icons">
118
  <?php foreach ( $order as $key => $name ) : ?>
@@ -123,20 +143,28 @@ class WC_Shortcodes_Social_Icons_Widget extends WP_Widget {
123
  <?php endforeach; ?>
124
  </ul>
125
  <p>
126
- <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label>
127
- <input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $title; ?>" />
 
 
 
 
 
 
 
 
 
 
 
 
128
  </p>
129
  <p>
130
- <label for="<?php echo $this->get_field_id('columns'); ?>"><?php _e('Number of Columns:'); ?></label>
131
- <select id="<?php echo $this->get_field_id('columns'); ?>" name="<?php echo $this->get_field_name('columns'); ?>">
132
- <option value="1"<?php selected( $columns, '1' ); ?>>1</option>';
133
- <option value="2"<?php selected( $columns, '2' ); ?>>2</option>';
134
- <option value="3"<?php selected( $columns, '3' ); ?>>3</option>';
135
- <option value="4"<?php selected( $columns, '4' ); ?>>4</option>';
136
- <option value="5"<?php selected( $columns, '5' ); ?>>5</option>';
137
- <option value="6"<?php selected( $columns, '6' ); ?>>6</option>';
138
- <option value="7"<?php selected( $columns, '7' ); ?>>7</option>';
139
- <option value="8"<?php selected( $columns, '8' ); ?>>8</option>';
140
  </select>
141
  </p>
142
  <script type="text/javascript">
36
  echo $args['before_title'] . $instance['title'] . $args['after_title'];
37
 
38
  // set class with the number of columns the user selected
39
+ $columns = $instance['columns'];
40
  if ( empty($columns) ) {
41
+ $columns = 'float-left';
42
+ }
43
+ $maxheight = 'none';
44
+ if ( isset( $instance['maxheight'] ) ) {
45
+ $maxheight = $instance['maxheight'];
46
  }
47
 
48
  $order = $instance['order'];
49
  $first = true;
50
 
51
+ $column_display = false;
52
+ if ( is_numeric( $columns ) & (int) $columns > 0 ) {
53
+ $column_display = true;
54
+ }
55
+
56
+ $classes = array();
57
+ $classes[] = 'wc-shortcodes-social-icons';
58
+ $classes[] = 'wc-shortcodes-clearfix';
59
+ $classes[] = 'wc-shortcodes-columns-'.$columns;
60
+ $classes[] = 'wc-shortcodes-maxheight-'.$maxheight;
61
 
62
+ $html = '<ul class="'.implode( ' ', $classes ).'">';
63
  $i = 0;
64
  foreach ($order as $key => $name) {
65
  $li_class = array();
66
  $li_class[] = 'wc-shortcodes-social-icon';
67
  $li_class[] = 'wc-shortcode-social-icon-' . $key;
68
 
69
+ if ( $column_display && $i % $columns == 0 ) {
70
  $li_class[] = 'clear-left';
71
+ }
72
 
73
  $link_option_name = WC_SHORTCODES_PREFIX . $key . '_link';
74
  $icon_option_name = WC_SHORTCODES_PREFIX . $key . '_icon';
101
 
102
  function update( $new_instance, $old_instance ) {
103
  $instance['title'] = strip_tags( stripslashes($new_instance['title']) );
104
+ $instance['columns'] = $new_instance['columns'];
105
+ $instance['maxheight'] = $new_instance['maxheight'];
106
  $instance['order'] = $new_instance['order'];
107
  return $instance;
108
  }
126
  );
127
  $order = isset( $instance['order'] ) ? $instance['order'] : $default_order;
128
  $title = isset( $instance['title'] ) ? $instance['title'] : 'Follow Me!';
129
+ $columns = isset( $instance['columns'] ) ? $instance['columns'] : 6;
130
+ $maxheight = isset( $instance['maxheight'] ) ? $instance['maxheight'] : 'none';
131
  ?>
132
+ <p>
133
+ <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label>
134
+ <input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $title; ?>" />
135
+ </p>
136
  <label><?php _e('Order:'); ?></label>
137
  <ul class="wc-shortcodes-clearfix wc-shortcodes-social-icons">
138
  <?php foreach ( $order as $key => $name ) : ?>
143
  <?php endforeach; ?>
144
  </ul>
145
  <p>
146
+ <label for="<?php echo $this->get_field_id('columns'); ?>"><?php _e('Display:'); ?></label>
147
+ <select id="<?php echo $this->get_field_id('columns'); ?>" name="<?php echo $this->get_field_name('columns'); ?>">
148
+ <option value="float-center"<?php selected( $columns, 'float-center' ); ?>>Float Center</option>';
149
+ <option value="float-left"<?php selected( $columns, 'float-left' ); ?>>Float Left</option>';
150
+ <option value="float-right"<?php selected( $columns, 'float-right' ); ?>>Float Right</option>';
151
+ <option value="1"<?php selected( $columns, '1' ); ?>>1 Column</option>';
152
+ <option value="2"<?php selected( $columns, '2' ); ?>>2 Columns</option>';
153
+ <option value="3"<?php selected( $columns, '3' ); ?>>3 Columns</option>';
154
+ <option value="4"<?php selected( $columns, '4' ); ?>>4 Columns</option>';
155
+ <option value="5"<?php selected( $columns, '5' ); ?>>5 Columns</option>';
156
+ <option value="6"<?php selected( $columns, '6' ); ?>>6 Columns</option>';
157
+ <option value="7"<?php selected( $columns, '7' ); ?>>7 Columns</option>';
158
+ <option value="8"<?php selected( $columns, '8' ); ?>>8 Columns</option>';
159
+ </select>
160
  </p>
161
  <p>
162
+ <label for="<?php echo $this->get_field_id('maxheight'); ?>"><?php _e('Max Height:'); ?></label>
163
+ <select id="<?php echo $this->get_field_id('maxheight'); ?>" name="<?php echo $this->get_field_name('maxheight'); ?>">
164
+ <option value="none"<?php selected( $maxheight, 'none' ); ?>>None</option>';
165
+ <?php for( $i = 10; $i <= 70; $i = $i + 2 ) : ?>
166
+ <option value="<?php echo $i; ?>"<?php selected( $maxheight, $i ); ?>><?php echo $i; ?>px</option>';
167
+ <?php endfor; ?>
 
 
 
 
168
  </select>
169
  </p>
170
  <script type="text/javascript">
readme.txt CHANGED
@@ -88,6 +88,10 @@ Use the shortcode manager in the TinyMCE text editor
88
 
89
  == Changelog ==
90
 
 
 
 
 
91
  ### Version 1.40
92
 
93
  * Fixed bug with Shortcode menu button hiding when latest WooCommerce plugin was installed.
88
 
89
  == Changelog ==
90
 
91
+ ### Version 1.42
92
+
93
+ * Improved social icons widget
94
+
95
  ### Version 1.40
96
 
97
  * Fixed bug with Shortcode menu button hiding when latest WooCommerce plugin was installed.
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.40
9
  License: GPLv2 or later
10
  */
11
 
12
- define( 'WC_SHORTCODES_VERSION', '1.40' );
13
  define( 'WC_SHORTCODES_PREFIX', 'wc_shortcodes_' );
14
  define( '_WC_SHORTCODES_PREFIX', '_wc_shortcodes_' );
15
  define( 'WC_SHORTCODES_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
5
  Description: A family of shortcodes to enhance site functionality.
6
  Author: Chris Baldelomar
7
  Author URI: http://webplantmedia.com/
8
+ Version: 1.42
9
  License: GPLv2 or later
10
  */
11
 
12
+ define( 'WC_SHORTCODES_VERSION', '1.42' );
13
  define( 'WC_SHORTCODES_PREFIX', 'wc_shortcodes_' );
14
  define( '_WC_SHORTCODES_PREFIX', '_wc_shortcodes_' );
15
  define( 'WC_SHORTCODES_PLUGIN_URL', plugin_dir_url( __FILE__ ) );