Here is the code I'm using to add the section to the Customize panel.
function apple_customize_register($wp_customize){
$wp_customize->add_section('apple_footer', array(
'title' => 'Footer',
'priority' => 120,
));
//------ display copyright in footer
$wp_customize->add_setting('theme_options[copyright]', array(
'capability' => 'edit_theme_options',
'type' => 'option',
));
$wp_customize->add_control('theme_options[copyright]', array(
'settings' => 'theme_options[copyright]',
'label' => __('Display Copyright'),
'section' => 'apple_footer',
'type' => 'checkbox',
'value' => '1'
));
}
add_action('customize_register', 'apple_customize_register');
How do I use the values in my theme. I have tryed get_option('theme_options[copyright]')
, get_theme_mod('theme_options[copyright]')
and many more, but all var_dump out bool(false)
. Please tell me what I'm missing.