I’m looking to add a class or ID to the panel-grid element.
This is what the current default layout outputs:
<div class="panel-grid"> <div class="panel-row-style"> </div> </div>
I have been able to add a custom class to the panel-row-style element using the siteorigin_panels_row_style_attributes hook which is great. However the current theme I’m working with is a mess and I’m stuck using it, so I need to add a class to the panel-grid to for some theme depended classes.
I did find siteorigin_panels_row_classes hook but I’m not having any luck finding the docs for this hook but it appears thats the hook I need to use to accomplish what I need. Is there any write on this?
I’d love to create a function like this:
function custom_row_style_fields($fields) {
$fields['inner'] = array(
'name' => __('Inner Container', 'siteorigin-panels'),
'type' => 'checkbox',
'group' => 'layout',
'description' => __('Add inner class to container', 'siteorigin-panels'),
'priority' => 4,
);
return $fields;
}
add_filter( 'siteorigin_panels_row_style_fields', 'custom_row_style_fields' );
function custom_row_style_attributes( $attributes, $args ) {
if( !empty( $args['inner'] ) ) {
array_push($attributes['class'], 'inner');
}
return $attributes;
}
However I have had little luck getting it to work. Any help would be great!