1,
), $attr );
$attr['span'] = absint( $attr['span'] );
$this->span[ $this->current_group ] += $attr['span'];
$content = wpautop( $content );
// Allow other shortcodes inside the column content.
if ( false !== strpos( $content, '[' ) )
$content = do_shortcode( shortcode_unautop( $content ) );
return sprintf( '
%s
', $this->span[ $this->current_group ], $attr['span'], $content );
}
function group( $attr, $content ) {
$this->current_group++;
$this->span[ $this->current_group ] = 0;
// Convent and count columns.
$content = do_shortcode( $content );
$count = $this->span[ $this->current_group ];
$content = str_replace( 'class="column column-number-' . $count, 'class="column column-number-' . $count . ' last', $content );
return sprintf( '%s
', $count, $content );
}
function enqueue_scripts() {
wp_enqueue_style( 'columns', plugins_url( 'columns.css', __FILE__ ) );
}
}
new Columns_Plugin;