Home>Support>Developer support for read-only widgets

Developer support for read-only widgets

Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

Saw this in the release notes. But what is it? I cant seem to find any info about it..

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 1 month 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