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].
Hey my friends,
i have some field which only be activ if a checkbox field is true.
how should i create this hide/show state emitter and state handler?
'a4newreadlessmore_desk_tab_unfolded' => array(
	            'type' => 'checkbox',
	            'label' => __('entfalteter Text im Desktop und Tablet', 'so-widgets-bundle'),
				'default' => false,
				'state_emitter' => array(
					'callback' => 'conditional',
					'args' => array( 'a4newreadlessmore_desk_tab_unfolded' )
				),
            ),
'a4newreadlessmore_desk_tab_height' => array(
                'type' => 'number',
                'label' => __('Height für Desktop und Tablet', 'so-widgets-bundle'),
                'description'   =>  'nur Höhe in Pixelanzahl wie 300',
'state_handler' => array(
'a4newreadlessmore_desk_tab_unfolded' => array('show')
)
            ),
Hi Sam,
You should set a state based on the value of the field. You can see an example of this in the Conditional Callback example and in the SiteOrigin Hero widget.