Home>Support>State Emitter for Checkboxes?

State Emitter for Checkboxes?

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')
)
            ),

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

  1. 6 years, 4 months ago Alex S
    Hi, I Work Here

    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.

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