Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 6 years ago.
Improve this questionWhat is the customizer section name? I want to add a field option under customizer woocommerce section. Or how will I add a field under woocommerce option? Can someone help me with that?
Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 6 years ago.
Improve this questionWhat is the customizer section name? I want to add a field option under customizer woocommerce section. Or how will I add a field under woocommerce option? Can someone help me with that?
Share Improve this question edited Jan 21, 2019 at 7:20 fuxia♦ 107k39 gold badges255 silver badges461 bronze badges asked Jan 20, 2019 at 22:54 Sumon HasanSumon Hasan 1033 bronze badges1 Answer
Reset to default 0WOO custmizer settings are under 'woocommerce' customizer panel ( panel has been added since WP 4.0)
add_action('customize_register',"SE_add_options_t_woo_customizer");
function SE_add_options_t_woo_customizer($wp_customize ){
$wp_customize->add_section( "my_new_section" ,
array(
'title' => "My new section",
'priority' => 20,
'panel' => 'woocommerce', // here is where you grab the woocommerce panel to add settings and controls to
)
);
$wp_customize->add_setting('my_new_setting',
array(
'default' => 'no',
'type' => 'option',
'capability' => 'manage_woocommerce',
'sanitize_callback' => 'wc_bool_to_string',
'sanitize_js_callback' => 'wc_string_to_bool',
)
);
$wp_customize->add_control('my_new_control',
array(
'label' => __( 'Control', 'woocommerce' ),
'description' => __( 'This is my new control', 'woocommerce' ),
'section' => 'my_new_section',
'settings' => 'my_new_setting',
'type' => 'checkbox',
)
);
}