Skip to content
Browse files

Move the row classes inside the check for the first column. It's the …

…only time it's needed.
  • Loading branch information...
1 parent ae5aba6 commit e7fb787c490e2e6eb6e3176fac998636e07b1863 @justintadlock committed
Showing with 5 additions and 5 deletions.
  1. +5 −5 grid-columns.php
View
10 grid-columns.php
@@ -186,18 +186,13 @@ public function do_shortcode( $attr, $content = null ) {
$this->is_last_column = true;
}
- /* Row classes. */
- $row_classes = array( 'column-grid', "column-grid-{$this->grid}" );
-
/* Object properties. */
$object_vars = get_object_vars( $this );
/* Allow devs to create custom classes. */
- $row_classes = apply_filters( 'gc_row_class', $row_classes, $attr, $object_vars );
$column_classes = apply_filters( 'gc_column_class', $column_classes, $attr, $object_vars );
/* Sanitize and join all classes. */
- $row_class = join( ' ', array_map( 'sanitize_html_class', array_unique( $row_classes ) ) );
$column_class = join( ' ', array_map( 'sanitize_html_class', array_unique( $column_classes ) ) );
/* Output */
@@ -205,6 +200,11 @@ public function do_shortcode( $attr, $content = null ) {
/* If this is the first column. */
if ( $this->is_first_column ) {
+ /* Row classes. */
+ $row_classes = array( 'column-grid', "column-grid-{$this->grid}" );
+ $row_classes = apply_filters( 'gc_row_class', $row_classes, $attr, $object_vars );
+ $row_class = join( ' ', array_map( 'sanitize_html_class', array_unique( $row_classes ) ) );
+
/* Open a wrapper <div> to contain the columns. */
$output .= '<div class="' . $row_class . '">';

0 comments on commit e7fb787

Please sign in to comment.
Something went wrong with that request. Please try again.