Home>Support>Developer support for read-only widgets
  1. 8 years, 3 months ago Greg Priday
    Hi, I Work Here

    Hi Rasmus

    Yeah, sorry, that was a bit of a quiet feature – developed for a little project we’re working on. I’ll be sure to document it. Here’s a little code snippet of how it works.

    function my_plugin_builder_supports( $supports, $post, $panels_data ){
    	if(
    		// Some check that we'll use to limit functionality
    	) {
    		$supports = array(
    			'addRow' => false,
    			'editRow' => false,
    			'deleteRow' => false,
    			'moveRow' => false,
    			'addWidget' => false,
    			'editWidget' => true,
    			'deleteWidget' => false,
    			'moveWidget' => false,
    			'revertToEditor' => false,
    			'prebuilt' => false,
    		);
    	}
    	return $supports;
    }
    add_filter( 'siteorigin_panels_builder_supports', 'my_plugin_builder_supports','' 10, 3 );
    

    What this does, is let you limit functionality in the actual Javascript side of Page Builder. So limit certain actions. In our case, we’re using it to create an interface where you create a layout in one screen, and on another screen, that layout is fixed – all you can do is edit the widget content.

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.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More