I was reading wordpress theme handbook , They said
$wp_customize->add_setting( 'myplugin_options[color]', array(
'type' => 'option',
'capability' => 'manage_options',
'default' => '#ff2525',
'sanitize_callback' => 'sanitize_hex_color',
) );
Note that the Customizer can handle options stored as keyed arrays for settings using the option type. This allows multiple settings to be stored in a single option that isn’t a theme mod. To retrieve and use the values of your Customizer options, use get_theme_mod() and get_option() with the setting id:
I tried.
$wp_customize->add_setting('options[toggle_hedaer]',array('default'=>true,'type'=>'option','capability' => 'manage_options','transport' => 'postMessage'));
$wp_customize->add_control('options[toggle_header]',array('section' => 'live_options','label'=>'Display header?','type'=>'checkbox'));
$wp_customize->add_setting('options[background]',array('default' => 'normal','type'=>'option','capability'=>'manage_options','transport' => 'postMessage'));
$wp_customize->add_control('options[background]',array('section'=>'live_options','label'=> 'Change Background','type'=>'radio','choices'=>array('normal'=>'Normal','inverse'=>'Inverse') ));
But it does not create any option in database, Can someone explain what i am doing wrong ? and what is the right method to store multiple setting in single option ?