Genesis Columns Advanced - Version 1.0.1

Version Description

  • Fixed bug associated with wpautop
Download this release

Release Info

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

Code changes from version 1.0.0 to 1.0.1

Files changed (3) hide show
  1. gca-shortcodes.php +31 -38
  2. genesis-columns-advanced.php +14 -1
  3. readme.txt +5 -2
gca-shortcodes.php CHANGED
@@ -1,13 +1,15 @@
1
  <?php
2
 
3
  defined( 'WPINC' ) or die;
4
-
5
-
6
- // Turns Timymce editor auto format off
7
-
8
- remove_filter( 'the_content', 'wpautop' );
9
-
10
 
 
 
 
 
 
 
 
 
11
  // Utility Shortcodes
12
 
13
  function gca_clearfix( $atts ) {
@@ -23,36 +25,36 @@ add_shortcode('vertical-spacer','gca_spacer');
23
  // Column Shortcodes - HALVES
24
 
25
  function gca_onehalf_first( $atts, $content = null ) {
26
- return '<div class="one-half first">'.do_shortcode($content).'</div>';
27
  }
28
  add_shortcode("one-half-first","gca_onehalf_first");
29
 
30
  function gca_onehalf( $atts, $content = null ) {
31
- return '<div class="one-half">'.do_shortcode($content).'</div>';
32
  }
33
  add_shortcode('one-half','gca_onehalf');
34
 
35
 
36
-
37
  // Column Shortcodes - THIRDS
38
 
39
  function gca_onethird_first( $atts, $content = null ) {
40
- return '<div class="one-third first">' .do_shortcode($content). '</div>';
41
  }
42
  add_shortcode("one-third-first","gca_onethird_first");
43
 
44
  function gca_onethird( $atts, $content = null ) {
45
- return '<div class="one-third">' .do_shortcode($content). '</div>';
46
  }
47
  add_shortcode('one-third','gca_onethird');
48
 
49
  function gca_twothirds_first( $atts, $content = null ) {
50
- return '<div class="two-thirds first">' .do_shortcode($content). '</div>';
51
  }
52
  add_shortcode("two-thirds-first","gca_twothirds_first");
53
 
54
  function gca_twothirds( $atts, $content = null ) {
55
- return '<div class="two-thirds">' .do_shortcode($content). '</div>';
56
  }
57
  add_shortcode('two-thirds','gca_twothirds');
58
 
@@ -61,32 +63,32 @@ add_shortcode('two-thirds','gca_twothirds');
61
  // Column Shortcodes - FOURTHS
62
 
63
  function gca_onefourth_first( $atts, $content = null ) {
64
- return '<div class="one-fourth first">' .do_shortcode($content). '</div>';
65
  }
66
  add_shortcode("one-fourth-first","gca_onefourth_first");
67
 
68
  function gca_onefourth( $atts, $content = null ) {
69
- return '<div class="one-fourth">' .do_shortcode($content). '</div>';
70
  }
71
  add_shortcode('one-fourth','gca_onefourth');
72
 
73
  function gca_twofourths_first( $atts, $content = null ) {
74
- return '<div class="two-fourths first">' .do_shortcode($content). '</div>';
75
  }
76
  add_shortcode("two-fourth-first","gca_twofourths_first");
77
 
78
  function gca_twofourths( $atts, $content = null ) {
79
- return '<div class="two-fourths">' .do_shortcode($content). '</div>';
80
  }
81
  add_shortcode('two-fourth','gca_twofourths');
82
 
83
  function gca_threefourths_first( $atts, $content = null ) {
84
- return '<div class="three-fourths first">' .do_shortcode($content). '</div>';
85
  }
86
  add_shortcode("three-fourths-first","gca_threefourths_first");
87
 
88
  function gca_threefourths( $atts, $content = null ) {
89
- return '<div class="three-fourths">' .do_shortcode($content). '</div>';
90
  }
91
  add_shortcode('three-fourths','gca_threefourths');
92
 
@@ -95,60 +97,51 @@ add_shortcode('three-fourths','gca_threefourths');
95
  // Column Shortcodes - SIXTHS
96
 
97
  function gca_onesixth_first( $atts, $content = null ) {
98
- return '<div class="one-sixth first">' .do_shortcode($content). '</div>';
99
  }
100
  add_shortcode("one-sixth-first","gca_onesixth_first");
101
 
102
  function gca_onesixth( $atts, $content = null ) {
103
- return '<div class="one-sixth">' .do_shortcode($content). '</div>';
104
  }
105
  add_shortcode('one-sixth','gca_onesixth');
106
 
107
  function gca_twosixths_first( $atts, $content = null ) {
108
- return '<div class="two-sixths first">' .do_shortcode($content). '</div>';
109
  }
110
  add_shortcode("two-sixths-first","gca_twosixths_first");
111
 
112
  function gca_twosixths ( $atts, $content = null ) {
113
- return '<div class="two-sixths">' .do_shortcode($content). '</div>';
114
  }
115
  add_shortcode("two-sixths","gca_twosixths");
116
 
117
  function gca_threesixths_first( $atts, $content = null ) {
118
- return '<div class="three-sixths first">' .do_shortcode($content). '</div>';
119
  }
120
  add_shortcode("three-sixths-first","gca_threesixths_first");
121
 
122
  function gca_threesixths( $atts, $content = null ) {
123
- return '<div class="three-sixths">' .do_shortcode($content). '</div>';
124
  }
125
  add_shortcode("three-sixths","gca_threesixths");
126
 
127
  function gca_foursixths_first( $atts, $content = null ) {
128
- return '<div class="four-sixths first">' .do_shortcode($content). '</div>';
129
  }
130
  add_shortcode("four-sixths-first","gca_foursixths_first");
131
 
132
  function gca_foursixths( $atts, $content = null ) {
133
- return '<div class="four-sixths">' .do_shortcode($content). '</div>';
134
  }
135
  add_shortcode("four-sixths","gca_foursixths");
136
 
137
  function gca_fivesixths_first( $atts, $content = null ) {
138
- return '<div class="five-sixths first">' .do_shortcode($content). '</div>';
139
  }
140
  add_shortcode("five-sixths-first","gca_fivesixths_first");
141
 
142
  function gca_fivesixths( $atts, $content = null ) {
143
- return '<div class="five-sixths">' .do_shortcode($content). '</div>';
144
  }
145
  add_shortcode("five-sixths","gca_fivesixths");
146
-
147
-
148
-
149
- // Turns Timymce editor auto format back on
150
-
151
- add_filter( 'the_content', 'wpautop' , 12);
152
-
153
-
154
-
1
  <?php
2
 
3
  defined( 'WPINC' ) or die;
 
 
 
 
 
 
4
 
5
+ // Strip content of AutoP
6
+ // Courtesy of Mathew Smith (Genesis Easy Columns)
7
+ function gca_strip_autop( $content ){
8
+ $content = do_shortcode( shortcode_unautop( $content ) );
9
+ $content = preg_replace( '#^<\/p>|^<br \/>|<p>$#', '', $content );
10
+ return $content;
11
+ }
12
+
13
  // Utility Shortcodes
14
 
15
  function gca_clearfix( $atts ) {
25
  // Column Shortcodes - HALVES
26
 
27
  function gca_onehalf_first( $atts, $content = null ) {
28
+ return '<div class="one-half first">' . gca_strip_autop( $content ) . '</div>';
29
  }
30
  add_shortcode("one-half-first","gca_onehalf_first");
31
 
32
  function gca_onehalf( $atts, $content = null ) {
33
+ return '<div class="one-half">' . gca_strip_autop( $content ) . '</div>';
34
  }
35
  add_shortcode('one-half','gca_onehalf');
36
 
37
 
38
+
39
  // Column Shortcodes - THIRDS
40
 
41
  function gca_onethird_first( $atts, $content = null ) {
42
+ return '<div class="one-third first">' . gca_strip_autop( $content ) . '</div>';
43
  }
44
  add_shortcode("one-third-first","gca_onethird_first");
45
 
46
  function gca_onethird( $atts, $content = null ) {
47
+ return '<div class="one-third">' . gca_strip_autop( $content ) . '</div>';
48
  }
49
  add_shortcode('one-third','gca_onethird');
50
 
51
  function gca_twothirds_first( $atts, $content = null ) {
52
+ return '<div class="two-thirds first">' . gca_strip_autop( $content ) . '</div>';
53
  }
54
  add_shortcode("two-thirds-first","gca_twothirds_first");
55
 
56
  function gca_twothirds( $atts, $content = null ) {
57
+ return '<div class="two-thirds">' . gca_strip_autop( $content ) . '</div>';
58
  }
59
  add_shortcode('two-thirds','gca_twothirds');
60
 
63
  // Column Shortcodes - FOURTHS
64
 
65
  function gca_onefourth_first( $atts, $content = null ) {
66
+ return '<div class="one-fourth first">' . gca_strip_autop( $content ) . '</div>';
67
  }
68
  add_shortcode("one-fourth-first","gca_onefourth_first");
69
 
70
  function gca_onefourth( $atts, $content = null ) {
71
+ return '<div class="one-fourth">' . gca_strip_autop( $content ) . '</div>';
72
  }
73
  add_shortcode('one-fourth','gca_onefourth');
74
 
75
  function gca_twofourths_first( $atts, $content = null ) {
76
+ return '<div class="two-fourths first">' . gca_strip_autop( $content ) . '</div>';
77
  }
78
  add_shortcode("two-fourth-first","gca_twofourths_first");
79
 
80
  function gca_twofourths( $atts, $content = null ) {
81
+ return '<div class="two-fourths">' . gca_strip_autop( $content ) . '</div>';
82
  }
83
  add_shortcode('two-fourth','gca_twofourths');
84
 
85
  function gca_threefourths_first( $atts, $content = null ) {
86
+ return '<div class="three-fourths first">' . gca_strip_autop( $content ) . '</div>';
87
  }
88
  add_shortcode("three-fourths-first","gca_threefourths_first");
89
 
90
  function gca_threefourths( $atts, $content = null ) {
91
+ return '<div class="three-fourths">' . gca_strip_autop( $content ) . '</div>';
92
  }
93
  add_shortcode('three-fourths','gca_threefourths');
94
 
97
  // Column Shortcodes - SIXTHS
98
 
99
  function gca_onesixth_first( $atts, $content = null ) {
100
+ return '<div class="one-sixth first">' . gca_strip_autop( $content ) . '</div>';
101
  }
102
  add_shortcode("one-sixth-first","gca_onesixth_first");
103
 
104
  function gca_onesixth( $atts, $content = null ) {
105
+ return '<div class="one-sixth">' . gca_strip_autop( $content ) . '</div>';
106
  }
107
  add_shortcode('one-sixth','gca_onesixth');
108
 
109
  function gca_twosixths_first( $atts, $content = null ) {
110
+ return '<div class="two-sixths first">' . gca_strip_autop( $content ) . '</div>';
111
  }
112
  add_shortcode("two-sixths-first","gca_twosixths_first");
113
 
114
  function gca_twosixths ( $atts, $content = null ) {
115
+ return '<div class="two-sixths">' . gca_strip_autop( $content ) . '</div>';
116
  }
117
  add_shortcode("two-sixths","gca_twosixths");
118
 
119
  function gca_threesixths_first( $atts, $content = null ) {
120
+ return '<div class="three-sixths first">' . gca_strip_autop( $content ) . '</div>';
121
  }
122
  add_shortcode("three-sixths-first","gca_threesixths_first");
123
 
124
  function gca_threesixths( $atts, $content = null ) {
125
+ return '<div class="three-sixths">' . gca_strip_autop( $content ) . '</div>';
126
  }
127
  add_shortcode("three-sixths","gca_threesixths");
128
 
129
  function gca_foursixths_first( $atts, $content = null ) {
130
+ return '<div class="four-sixths first">' . gca_strip_autop( $content ) . '</div>';
131
  }
132
  add_shortcode("four-sixths-first","gca_foursixths_first");
133
 
134
  function gca_foursixths( $atts, $content = null ) {
135
+ return '<div class="four-sixths">' . gca_strip_autop( $content ) . '</div>';
136
  }
137
  add_shortcode("four-sixths","gca_foursixths");
138
 
139
  function gca_fivesixths_first( $atts, $content = null ) {
140
+ return '<div class="five-sixths first">' . gca_strip_autop( $content ) . '</div>';
141
  }
142
  add_shortcode("five-sixths-first","gca_fivesixths_first");
143
 
144
  function gca_fivesixths( $atts, $content = null ) {
145
+ return '<div class="five-sixths">' . gca_strip_autop( $content ) . '</div>';
146
  }
147
  add_shortcode("five-sixths","gca_fivesixths");
 
 
 
 
 
 
 
 
 
genesis-columns-advanced.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Genesis Columns Advanced
4
  Plugin URI: http://www.outermostdesign.com
5
  Description: Generates shortcodes for all 35 possible column layouts when using Genesis column classes.
6
- Version: 1.0.0
7
  Author: Nick Diego
8
  Author URI: http://www.outermostdesign.com
9
  Text Domain: genesis-custom-headers
@@ -64,6 +64,19 @@ function gca_register_mce_button( $buttons ) {
64
  return $buttons;
65
  }
66
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  add_action( 'wp_enqueue_scripts', 'gca_frontend_scripts_enqueue' );
68
  /**
69
  * Loads scripts to the frontend
3
  Plugin Name: Genesis Columns Advanced
4
  Plugin URI: http://www.outermostdesign.com
5
  Description: Generates shortcodes for all 35 possible column layouts when using Genesis column classes.
6
+ Version: 1.0.1
7
  Author: Nick Diego
8
  Author URI: http://www.outermostdesign.com
9
  Text Domain: genesis-custom-headers
64
  return $buttons;
65
  }
66
 
67
+ add_filter( 'the_content', 'gca_shortcode_empty_paragraph_fix' );
68
+ /**
69
+ * Filters the content to remove any extra paragraph or break tags caused by shortcodes.
70
+ */
71
+ function gca_shortcode_empty_paragraph_fix( $content ) {
72
+ $array = array(
73
+ '<p>[' => '[',
74
+ ']</p>' => ']',
75
+ ']<br />' => ']'
76
+ );
77
+ return strtr( $content, $array );
78
+ }
79
+
80
  add_action( 'wp_enqueue_scripts', 'gca_frontend_scripts_enqueue' );
81
  /**
82
  * Loads scripts to the frontend
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: ndiego, outermostdesign
3
  Tags: columns, shortcode, genesis, Genesis Framework, genesiswp, TinyMCE, admin
4
  Requires at least: 3.6
5
- Tested up to: 4.1
6
- Stable tag: 1.0.0
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -52,3 +52,6 @@ This was a conscious decision in order for the plugin to stay inline with the co
52
  = 1.0.0 =
53
  * Initial Release
54
 
 
 
 
2
  Contributors: ndiego, outermostdesign
3
  Tags: columns, shortcode, genesis, Genesis Framework, genesiswp, TinyMCE, admin
4
  Requires at least: 3.6
5
+ Tested up to: 4.2.2
6
+ Stable tag: 1.0.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
52
  = 1.0.0 =
53
  * Initial Release
54
 
55
+ = 1.0.1 =
56
+ * Fixed bug associated with wpautop
57
+