This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Replies

2
  1. Andrew Misplon Staff 6 years, 4 months ago

    Hi Manolo

    Thanks for reaching out.

    We have examples of how to automatically add classes in our developer documentation. Unfortunately, it isn’t a normal usage task but a developer/programming level task. I don’t know that we have examples of first detecting whether a widget is present in a row before adding a class. I’ll find out and come back to you.

  2. Andrew Misplon Staff 6 years, 3 months ago

    Hi Manolo

    We’ll add this to our developer documentation shortly. Below is what we’re able to offer:

    function myplugin_filter_widget_classes( $classes, $widget_class, $instance, $widget_info ) {
    	if ( $widget_class == 'SiteOrigin_Widget_Editor_Widget' ) {
    		$classes[] = 'custom-class';
    	}
    	return $classes;
    }
    add_filter( 'siteorigin_panels_widget_classes','myplugin_filter_widget_classes', 10, 4 );

    Change custom-class to the class name you want to add. That’ll automatically add your class to the so-panel div if an Editor widget is contained within. Not quite what you asked for but what we’re able to offer at the moment. I hope it helps in some way. Here is the result https://imgur.com/a/Ul5JEu3.

Replies on this thread are closed.

Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Have a different question or issue?

Start New Thread