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. Vitaly Dmitriev 6 years, 6 months ago

    Afte some time of styding source code, i found a solution. Here is my function

    function get_widget_instance( $content, $widget_class ) {
    	$instance = null;
    	$post_blocks = parse_blocks($content);
    	if( ! empty( $post_blocks ) ) {
    		foreach( $post_blocks as $block ) {
    			$widgets = $block['attrs']['panelsData']['widgets'];
    			if( ! empty( $widgets ) ) {
    				foreach( $widgets as $widget ) {
    					if( $widget_class === $widget['panels_info']['class'] ) {
    						$instance = $widget;
    						break;
    					}
    				}
    			}
    		}
    	}
    	return $instance;
    }
  2. Alex S Staff 6 years, 6 months ago

    Hi Vitaly,

    Great to hear you were able to come up with a solution that works for your setup.

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