wp-plugins/siteorigin-panels — pull request #1 by primozcigler (2014-03-24 13:53:17+00:00)
Title: Added two filters before and after panel output

Hi Greg,

First of all, I am totally amazed how good this plugin works and more importantly the quality of the code. I must admin the best WP plugin I have seen so far.

I am implementing it in the new theme and I needed to add additional two filters - I think they they are very good way to change the rows, maybe you will consider them adding to the plugin itself.

What they do is that they enable the 3rd party developer to hook in the plugin and add additional HTML if needed before each outputted row (we are in function `siteorigin_panels_render`).

My real-word scenario: I added the special row styles like this:

```php
/**
* Add custom row styles to the Page Builder
*
* @param array $styles
* @return array
*/
function organique_panels_row_styles( $styles ) {
$styles['wide-light'] = _x('Wide Light', 'backend', 'organique_wp');
return $styles;
}
add_filter( 'siteorigin_panels_row_styles', 'organique_panels_row_styles', 10, 1 );
```

But this gives me only the additional class to the row. What I wanted was to close some divs of the container which is set before the `the_content()` is called, so that special row would be expand to the to the borders of the screen. So with these two new hooks that is easy to achieve, like this:

```php
/**
* Add custom row styles to the Page Builder
*
* @param array $styles
* @return array
*/
function organique_panels_before_row( $default, $row_data ) {
if ( in_array( 'wide-light', $row_data[ 'style' ] ) ) {
return '

';
} else {
return $default;
}
}
add_filter( 'siteorigin_panels_before_row', 'organique_panels_before_row', 10, 2 );

/**
* Add custom row styles to the Page Builder
*
* @param array $styles
* @return array
*/
function organique_panels_after_row( $default, $row_data ) {
if ( in_array( 'wide-light', $row_data[ 'style' ] ) ) {
return '

';
} else {
return $default;
}
}
add_filter( 'siteorigin_panels_after_row', 'organique_panels_after_row', 10, 2 );
```

I hope you include that in the next update.