| 1 |
<?php |
| 2 |
/** |
| 3 |
* Load loftloader lite main switcher related functions |
| 4 |
* |
| 5 |
* @since version 2.0.0 |
| 6 |
*/ |
| 7 |
add_action( 'customize_register', 'loftloader_customize_main', 10 ); |
| 8 |
function loftloader_customize_main( $wp_customize ) { |
| 9 |
global $loftloader_default_settings; |
| 10 |
|
| 11 |
$wp_customize->add_setting( new WP_Customize_Setting( $wp_customize, 'loftloader_main_switch', array( |
| 12 |
'default' => $loftloader_default_settings['loftloader_main_switch'], |
| 13 |
'transport' => 'refresh', |
| 14 |
'type' => 'option', |
| 15 |
'sanitize_callback' => 'loftloader_sanitize_checkbox' |
| 16 |
) ) ); |
| 17 |
|
| 18 |
$wp_customize->add_section( new LoftLoader_Customize_Section( $wp_customize, 'loftloader_switch', array( |
| 19 |
'title' => esc_html__('Enable LoftLoader', 'loftloader'), |
| 20 |
'type' => 'loftloader_switch', |
| 21 |
'priority' => 10, |
| 22 |
) ) ); |
| 23 |
|
| 24 |
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'loftloader_main_switch', array( |
| 25 |
'type' => 'checkbox', |
| 26 |
'label' => esc_html__( 'Enable LoftLoader', 'loftloader' ), |
| 27 |
'choices' => array('on' => ''), |
| 28 |
'section' => 'loftloader_switch', |
| 29 |
'settings' => 'loftloader_main_switch' |
| 30 |
) ) ); |
| 31 |
} |