Hey guys,
The Widget CSS Classes plugin doesn’t work with Page Builder (and I couldn’t figure out how to easily get it to work), so I’ve worked around it for my uses. This may help you, depending on what you’re doing.
Firstly, I added this line:
$classes=apply_filters(“siteorigin_panels_custom_widget_class”,$classes,$the_widget,$instance);
above the setting of $args in siteorigin_panels_the_widget() in siteorigin-panels.php (its around line 825).
If the Site Origin team could include this filter, or similar, in a future version that would be fantastic!
Then, from your theme’s functions.php, you can access this filter to add any classes that you need to the widget. You have the use of both the widget’s object AND its instance, so you could probably use these to do almost anything you wanted to. For example, I’m using the Better Menu plugin to allow classes to be added to a menu. All I’ve set up this function to do is add that same class to the widget if its in the menu. Of course, from this function you could print_r the variables you have received so you can check what you have to work with:
function yourtheme_modify_classes($classes,$widget,$instance){
if(isset($instance[“menu_class”])) $classes[]=$instance[“menu_class”];
return $classes;
}
add_filter(“siteorigin_panels_custom_widget_class”,”yourtheme_modify_classes”,10,3);