Genesis Columns Advanced - Version 2.0.3

Version Description

(20171-12) = * Fixed bug with incorrect column widths (Thanks fourlightsweb)

Download this release

Release Info

Developer ndiego
Plugin Icon 128x128 Genesis Columns Advanced
Version 2.0.3
Comparing to
See all releases

Code changes from version 2.0.2 to 2.0.3

css/gca-column-styles.css CHANGED
@@ -1,9 +1,9 @@
1
  /**
2
- * The builtin column class CSS file for Genesis Columns Advanced.
3
  * This file can be disabled using the gca_load_column_styles filter.
4
  *
5
  * Width: 100%
6
- * Gutter: 2.5641025641%
7
  * Link: http://www.nickdiego.com/plugins/genesis-columns-advanced/
8
  ----------------------------------------------------------------------------- */
9
 
@@ -12,70 +12,70 @@
12
  --------------------------------------------- */
13
 
14
  .five-sixths,
15
- .four-fifths,
16
  .four-sixths,
 
17
  .one-fifth,
18
  .one-fourth,
19
  .one-half,
20
  .one-sixth,
21
  .one-third,
22
- .three-fifths,
23
  .three-fourths,
 
24
  .three-sixths,
25
- .two-fifths,
26
  .two-fourths,
 
27
  .two-sixths,
28
  .two-thirds {
29
  float: left;
30
- margin-left: 2.5641025641%;
31
  }
32
 
33
  .one-half,
34
  .three-sixths,
35
  .two-fourths {
36
- width: 48.717948718%;
37
  }
38
 
39
  .one-third,
40
  .two-sixths {
41
- width: 31.6239316239%;
42
  }
43
 
44
  .four-sixths,
45
  .two-thirds {
46
- width: 63.2478632479%;
47
  }
48
 
49
  .one-fourth {
50
- width: 23.0769230769%;
51
  }
52
 
53
  .three-fourths {
54
- width: 69.2307692308%;
55
  }
56
 
57
  .one-fifth {
58
- width: 17.9487179487%;
59
  }
60
 
61
  .two-fifths {
62
- width: 35.8974358974%;
63
  }
64
 
65
  .three-fifths {
66
- width: 53.8461538462%;
67
  }
68
 
69
  .four-fifths {
70
- width: 71.7948717949%;
71
  }
72
 
73
  .one-sixth {
74
- width: 14.5299145299%;
75
  }
76
 
77
  .five-sixths {
78
- width: 72.6495726496%;
79
  }
80
 
81
  .first {
@@ -107,7 +107,7 @@
107
  margin: 0;
108
  width: 100%;
109
  }
110
-
111
  }
112
 
113
 
1
  /**
2
+ * The builtin column class CSS file for Genesis Columns Advanced.
3
  * This file can be disabled using the gca_load_column_styles filter.
4
  *
5
  * Width: 100%
6
+ * Gutter: 2.564102564102564%
7
  * Link: http://www.nickdiego.com/plugins/genesis-columns-advanced/
8
  ----------------------------------------------------------------------------- */
9
 
12
  --------------------------------------------- */
13
 
14
  .five-sixths,
 
15
  .four-sixths,
16
+ .four-fifths,
17
  .one-fifth,
18
  .one-fourth,
19
  .one-half,
20
  .one-sixth,
21
  .one-third,
 
22
  .three-fourths,
23
+ .three-fifths,
24
  .three-sixths,
 
25
  .two-fourths,
26
+ .two-fifths,
27
  .two-sixths,
28
  .two-thirds {
29
  float: left;
30
+ margin-left: 2.564102564102564%;
31
  }
32
 
33
  .one-half,
34
  .three-sixths,
35
  .two-fourths {
36
+ width: 48.717948717948715%;
37
  }
38
 
39
  .one-third,
40
  .two-sixths {
41
+ width: 31.623931623931625%;
42
  }
43
 
44
  .four-sixths,
45
  .two-thirds {
46
+ width: 65.81196581196582%;
47
  }
48
 
49
  .one-fourth {
50
+ width: 23.076923076923077%;
51
  }
52
 
53
  .three-fourths {
54
+ width: 74.35897435897435%;
55
  }
56
 
57
  .one-fifth {
58
+ width: 17.94871794871795%;
59
  }
60
 
61
  .two-fifths {
62
+ width: 38.46153846153846%;
63
  }
64
 
65
  .three-fifths {
66
+ width: 58.97435897435898%;
67
  }
68
 
69
  .four-fifths {
70
+ width: 79.48717948717949%;
71
  }
72
 
73
  .one-sixth {
74
+ width: 14.52991452991453%;
75
  }
76
 
77
  .five-sixths {
78
+ width: 82.90598290598291%;
79
  }
80
 
81
  .first {
107
  margin: 0;
108
  width: 100%;
109
  }
110
+
111
  }
112
 
113
 
genesis-columns-advanced.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  /**
3
  * Plugin Name: Genesis Columns Advanced
4
- * Plugin URI: http://www.nickdiego.com/plugins/genesis-columns-advanced
5
  * Description: Adds shortcodes to easily create up to 42 different columned layouts.
6
- * Version: 2.0.2
7
  * Author: Nick Diego
8
- * Author URI: http://www.nickdiego.com
9
  * Text Domain: genesis-columns-advanced
10
  * License: GPLv2
11
  *
@@ -46,22 +46,22 @@ class Genesis_Columns_Advanced {
46
  * @since 2.0.0
47
  */
48
  public function init() {
49
-
50
  load_plugin_textdomain( 'genesis-columns-advanced', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
51
 
52
  add_action('admin_init', array( $this, 'add_tinymce_button' ) );
53
-
54
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts_enqueue' ) );
55
  add_action( 'wp_enqueue_scripts', array( $this, 'frontend_scripts_enqueue' ) );
56
-
57
  $this->add_shortcodes();
58
-
59
  add_filter( 'the_content', array( $this, 'shortcode_empty_paragraph_fix' ) );
60
-
61
  add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 2 );
62
  }
63
-
64
-
65
  /**
66
  * Initialize the columns shortcode tinymce button
67
  *
@@ -81,8 +81,8 @@ class Genesis_Columns_Advanced {
81
  add_action( 'admin_print_footer_scripts', array( $this, 'tinymce_popup' ), 100 );
82
  }
83
  }
84
-
85
-
86
  /**
87
  * Declare script for new button
88
  *
@@ -133,24 +133,24 @@ class Genesis_Columns_Advanced {
133
  public function tinymce_popup() {
134
  include_once dirname( __FILE__ ) . '/tinymce/popup.php';
135
  }
136
-
137
-
138
  /**
139
  * Loads scripts/styles to the admin
140
  *
141
  * @since 1.0.0
142
  */
143
  function admin_scripts_enqueue() {
144
-
145
  wp_register_script( 'gca-popup-scripts', plugin_dir_url( __FILE__ ) . 'tinymce/js/popup.js' );
146
  wp_enqueue_script( 'gca-popup-scripts' );
147
-
148
  // Used for adding translations to javascript
149
- wp_localize_script(
150
- 'gca-popup-scripts',
151
- 'gca_localize_scripts',
152
- array(
153
- 'first_column' => __( 'Place your content for the first column here.', 'genesis-columns-advanced' ),
154
  'second_column' => __( 'Place your content for the second column here.', 'genesis-columns-advanced' ),
155
  'third_column' => __( 'Place your content for the third column here.', 'genesis-columns-advanced' ),
156
  'fourth_column' => __( 'Place your content for the fourth column here.', 'genesis-columns-advanced' ),
@@ -178,17 +178,17 @@ class Genesis_Columns_Advanced {
178
  wp_enqueue_style( 'gca-column-styles', plugin_dir_url( __FILE__ ) . 'css/gca-column-styles.css' );
179
  }
180
  }
181
-
182
-
183
  public function add_shortcodes() {
184
  foreach ( $this->get_shortcodes() as $shortcode => $atts ) {
185
  add_shortcode( $shortcode, array( $this, 'shortcodes' ) );
186
  }
187
  }
188
-
189
-
190
  public function get_shortcodes() {
191
-
192
  static $all_shortcodes;
193
 
194
  if ( ! empty( $all_shortcodes ) ) {
@@ -212,17 +212,17 @@ class Genesis_Columns_Advanced {
212
  'three-sixths' => array( 'type' => 'column' ),
213
  'four-sixths' => array( 'type' => 'column' ),
214
  'five-sixths' => array( 'type' => 'column' ),
215
-
216
  'clearfix' => array( 'type' => 'utility' ),
217
  'vertical-spacer' => array( 'type' => 'utility' ),
218
  'columns-container' => array( 'type' => 'utility' ),
219
  ));
220
-
221
  if ( ! $shortcodes ) {
222
  return array();
223
  }
224
-
225
-
226
  foreach ( $shortcodes as $shortcode => $atts ) {
227
 
228
  // add prefix
@@ -232,7 +232,7 @@ class Genesis_Columns_Advanced {
232
  'class' => $shortcode,
233
  'type' => $atts['type']
234
  );
235
-
236
  // If it's a utlity shortcode, don't add the corresponding first shortcode
237
  if ( $atts['type'] == 'column' ) {
238
 
@@ -245,50 +245,50 @@ class Genesis_Columns_Advanced {
245
 
246
  return $all_shortcodes;
247
  }
248
-
249
-
250
  public function shortcodes( $atts, $content = null, $name ) {
251
-
252
  $atts = shortcode_atts( array(
253
  'id' => '',
254
  'class' => '',
255
  'style' => '',
256
  ), $atts );
257
-
258
  // Get array of all shortcode to retrieve additional attributes
259
  $all_shortcodes = $this->get_shortcodes();
260
-
261
  // Determine the type of shortcode we are working with
262
  $type = $all_shortcodes[$name]['type'];
263
-
264
  // Setup the markup and identifier (both filterable)
265
  $markup = ( $type == 'utility' ) ? apply_filters( 'gca_utility_markup', 'div' ) : apply_filters( 'gca_column_markup', 'div' );
266
  $identifier = ( $type == 'utility' ) ? apply_filters( 'gca_utility_identifier_class', 'gca-utility' ) : apply_filters( 'gca_column_identifier_class', 'gca-column' );
267
-
268
  // Setup the id
269
  $id = sanitize_text_field( $atts['id'] );
270
  $id = ( $id != '' ) ? ' id="' . $id . '"' : '';
271
-
272
  // Setup the classes
273
- $class = ' ' . $all_shortcodes[$name]['class'];
274
- $extra_classes = sanitize_text_field( $atts['class'] );
275
  $extra_classes = ( $extra_classes != '' ) ? ' ' . $extra_classes : '';
276
  $class = ' class="' . $identifier . $class . $extra_classes . '"';
277
-
278
  // Setup the styles
279
- $style = sanitize_text_field( $atts['style'] );
280
  $style = ( $style != '' ) ? ' style="' . $style . '"' : '';
281
-
282
  // Setup the content
283
  $content = ( $content ) ? $this->content_strip_autop( $content ) : '';
284
-
285
  // Built output
286
  $output = '<' . $markup . $id . $class . $style . '>' . $content . '</' . $markup . '>';
287
-
288
  return $output;
289
  }
290
-
291
-
292
  /**
293
  * Strip content of AutoP
294
  * Courtesy of Mathew Smith (Genesis Easy Columns)
@@ -298,8 +298,8 @@ class Genesis_Columns_Advanced {
298
  $content = do_shortcode( shortcode_unautop( trim( $content ) ) );
299
  return $content;
300
  }
301
-
302
-
303
  /**
304
  * Filters the content to remove any extra paragraph or break tags caused by shortcodes.
305
  *
@@ -316,8 +316,8 @@ class Genesis_Columns_Advanced {
316
  );
317
  return strtr( $content, $array );
318
  }
319
-
320
-
321
  /**
322
  * Adds additional links to the plugin row meta links
323
  *
@@ -350,7 +350,7 @@ class Genesis_Columns_Advanced {
350
 
351
  return $links;
352
  }
353
-
354
  }
355
 
356
  new Genesis_Columns_Advanced();
1
  <?php
2
  /**
3
  * Plugin Name: Genesis Columns Advanced
4
+ * Plugin URI: https://www.nickdiego.com/plugins/genesis-columns-advanced
5
  * Description: Adds shortcodes to easily create up to 42 different columned layouts.
6
+ * Version: 2.0.3
7
  * Author: Nick Diego
8
+ * Author URI: https://www.nickdiego.com
9
  * Text Domain: genesis-columns-advanced
10
  * License: GPLv2
11
  *
46
  * @since 2.0.0
47
  */
48
  public function init() {
49
+
50
  load_plugin_textdomain( 'genesis-columns-advanced', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
51
 
52
  add_action('admin_init', array( $this, 'add_tinymce_button' ) );
53
+
54
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts_enqueue' ) );
55
  add_action( 'wp_enqueue_scripts', array( $this, 'frontend_scripts_enqueue' ) );
56
+
57
  $this->add_shortcodes();
58
+
59
  add_filter( 'the_content', array( $this, 'shortcode_empty_paragraph_fix' ) );
60
+
61
  add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 2 );
62
  }
63
+
64
+
65
  /**
66
  * Initialize the columns shortcode tinymce button
67
  *
81
  add_action( 'admin_print_footer_scripts', array( $this, 'tinymce_popup' ), 100 );
82
  }
83
  }
84
+
85
+
86
  /**
87
  * Declare script for new button
88
  *
133
  public function tinymce_popup() {
134
  include_once dirname( __FILE__ ) . '/tinymce/popup.php';
135
  }
136
+
137
+
138
  /**
139
  * Loads scripts/styles to the admin
140
  *
141
  * @since 1.0.0
142
  */
143
  function admin_scripts_enqueue() {
144
+
145
  wp_register_script( 'gca-popup-scripts', plugin_dir_url( __FILE__ ) . 'tinymce/js/popup.js' );
146
  wp_enqueue_script( 'gca-popup-scripts' );
147
+
148
  // Used for adding translations to javascript
149
+ wp_localize_script(
150
+ 'gca-popup-scripts',
151
+ 'gca_localize_scripts',
152
+ array(
153
+ 'first_column' => __( 'Place your content for the first column here.', 'genesis-columns-advanced' ),
154
  'second_column' => __( 'Place your content for the second column here.', 'genesis-columns-advanced' ),
155
  'third_column' => __( 'Place your content for the third column here.', 'genesis-columns-advanced' ),
156
  'fourth_column' => __( 'Place your content for the fourth column here.', 'genesis-columns-advanced' ),
178
  wp_enqueue_style( 'gca-column-styles', plugin_dir_url( __FILE__ ) . 'css/gca-column-styles.css' );
179
  }
180
  }
181
+
182
+
183
  public function add_shortcodes() {
184
  foreach ( $this->get_shortcodes() as $shortcode => $atts ) {
185
  add_shortcode( $shortcode, array( $this, 'shortcodes' ) );
186
  }
187
  }
188
+
189
+
190
  public function get_shortcodes() {
191
+
192
  static $all_shortcodes;
193
 
194
  if ( ! empty( $all_shortcodes ) ) {
212
  'three-sixths' => array( 'type' => 'column' ),
213
  'four-sixths' => array( 'type' => 'column' ),
214
  'five-sixths' => array( 'type' => 'column' ),
215
+
216
  'clearfix' => array( 'type' => 'utility' ),
217
  'vertical-spacer' => array( 'type' => 'utility' ),
218
  'columns-container' => array( 'type' => 'utility' ),
219
  ));
220
+
221
  if ( ! $shortcodes ) {
222
  return array();
223
  }
224
+
225
+
226
  foreach ( $shortcodes as $shortcode => $atts ) {
227
 
228
  // add prefix
232
  'class' => $shortcode,
233
  'type' => $atts['type']
234
  );
235
+
236
  // If it's a utlity shortcode, don't add the corresponding first shortcode
237
  if ( $atts['type'] == 'column' ) {
238
 
245
 
246
  return $all_shortcodes;
247
  }
248
+
249
+
250
  public function shortcodes( $atts, $content = null, $name ) {
251
+
252
  $atts = shortcode_atts( array(
253
  'id' => '',
254
  'class' => '',
255
  'style' => '',
256
  ), $atts );
257
+
258
  // Get array of all shortcode to retrieve additional attributes
259
  $all_shortcodes = $this->get_shortcodes();
260
+
261
  // Determine the type of shortcode we are working with
262
  $type = $all_shortcodes[$name]['type'];
263
+
264
  // Setup the markup and identifier (both filterable)
265
  $markup = ( $type == 'utility' ) ? apply_filters( 'gca_utility_markup', 'div' ) : apply_filters( 'gca_column_markup', 'div' );
266
  $identifier = ( $type == 'utility' ) ? apply_filters( 'gca_utility_identifier_class', 'gca-utility' ) : apply_filters( 'gca_column_identifier_class', 'gca-column' );
267
+
268
  // Setup the id
269
  $id = sanitize_text_field( $atts['id'] );
270
  $id = ( $id != '' ) ? ' id="' . $id . '"' : '';
271
+
272
  // Setup the classes
273
+ $class = ' ' . $all_shortcodes[$name]['class'];
274
+ $extra_classes = sanitize_text_field( $atts['class'] );
275
  $extra_classes = ( $extra_classes != '' ) ? ' ' . $extra_classes : '';
276
  $class = ' class="' . $identifier . $class . $extra_classes . '"';
277
+
278
  // Setup the styles
279
+ $style = sanitize_text_field( $atts['style'] );
280
  $style = ( $style != '' ) ? ' style="' . $style . '"' : '';
281
+
282
  // Setup the content
283
  $content = ( $content ) ? $this->content_strip_autop( $content ) : '';
284
+
285
  // Built output
286
  $output = '<' . $markup . $id . $class . $style . '>' . $content . '</' . $markup . '>';
287
+
288
  return $output;
289
  }
290
+
291
+
292
  /**
293
  * Strip content of AutoP
294
  * Courtesy of Mathew Smith (Genesis Easy Columns)
298
  $content = do_shortcode( shortcode_unautop( trim( $content ) ) );
299
  return $content;
300
  }
301
+
302
+
303
  /**
304
  * Filters the content to remove any extra paragraph or break tags caused by shortcodes.
305
  *
316
  );
317
  return strtr( $content, $array );
318
  }
319
+
320
+
321
  /**
322
  * Adds additional links to the plugin row meta links
323
  *
350
 
351
  return $links;
352
  }
353
+
354
  }
355
 
356
  new Genesis_Columns_Advanced();
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: ndiego, outermostdesign
3
  Donate Link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=D2LLR72CD82JJ
4
  Tags: columns, shortcode, genesis, Genesis Framework, genesiswp, TinyMCE, admin
5
  Requires at least: 3.6
6
- Tested up to: 4.6
7
- Stable tag: 2.0.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -136,6 +136,9 @@ Let us know what you are looking for in the support forums, and we will do our b
136
 
137
  == Changelog ==
138
 
 
 
 
139
  = 2.0.2 (2016-8-14) =
140
  * Added default styling to columns-container shortcode to fix styling bug
141
 
3
  Donate Link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=D2LLR72CD82JJ
4
  Tags: columns, shortcode, genesis, Genesis Framework, genesiswp, TinyMCE, admin
5
  Requires at least: 3.6
6
+ Tested up to: 4.9
7
+ Stable tag: 2.0.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
136
 
137
  == Changelog ==
138
 
139
+ = 2.0.3 (2017–1-12) =
140
+ * Fixed bug with incorrect column widths (Thanks fourlightsweb)
141
+
142
  = 2.0.2 (2016-8-14) =
143
  * Added default styling to columns-container shortcode to fix styling bug
144