| 1 |
<?php |
| 2 |
/** |
| 3 |
* Load loftloader lite more section |
| 4 |
* |
| 5 |
* @since version 2.1.3 |
| 6 |
*/ |
| 7 |
add_action( 'customize_register', 'loftloader_customize_more', 45 ); |
| 8 |
function loftloader_customize_more( $wp_customize ) { |
| 9 |
global $loftloader_default_settings; |
| 10 |
|
| 11 |
$wp_customize->add_panel( new WP_Customize_Panel ( $wp_customize, 'loftloader_panel_more', array( |
| 12 |
'title' => esc_html__( 'More', 'loftloader' ), |
| 13 |
'priority' => 52 |
| 14 |
) ) ); |
| 15 |
|
| 16 |
$wp_customize->add_section( new LoftLoader_Customize_Section( $wp_customize, 'loftloader_section_max_load_time', array( |
| 17 |
'title' => esc_html__( 'Maximum Load Time', 'loftloader' ), |
| 18 |
'panel' => 'loftloader_panel_more' |
| 19 |
) ) ); |
| 20 |
$wp_customize->add_section( new LoftLoader_Customize_Section( $wp_customize, 'loftloader_section_close_button', array( |
| 21 |
'title' => esc_html__( 'Close Button', 'loftloader' ), |
| 22 |
'panel' => 'loftloader_panel_more' |
| 23 |
) ) ); |
| 24 |
$wp_customize->add_section( new LoftLoader_Customize_Section( $wp_customize, 'loftloader_section_remove_settings', array( |
| 25 |
'title' => esc_html__( 'Plugin Data', 'loftloader' ), |
| 26 |
'panel' => 'loftloader_panel_more' |
| 27 |
) ) ); |
| 28 |
|
| 29 |
$wp_customize->add_setting( new WP_Customize_Setting( $wp_customize, 'loftloader_max_load_time', array( |
| 30 |
'default' => $loftloader_default_settings['loftloader_max_load_time'], |
| 31 |
'transport' => 'postMessage', |
| 32 |
'type' => 'option', |
| 33 |
'sanitize_callback' => 'loftloader_sanitize_number' |
| 34 |
) ) ); |
| 35 |
$wp_customize->add_setting( new WP_Customize_Setting( $wp_customize, 'loftloader_show_close_timer', array( |
| 36 |
'default' => $loftloader_default_settings['loftloader_show_close_timer'], |
| 37 |
'transport' => 'postMessage', |
| 38 |
'type' => 'option', |
| 39 |
'sanitize_callback' => 'absint' |
| 40 |
) ) ); |
| 41 |
$wp_customize->add_setting( new WP_Customize_Setting( $wp_customize, 'loftloader_show_close_tip', array( |
| 42 |
'default' => $loftloader_default_settings['loftloader_show_close_tip'], |
| 43 |
'transport' => 'postMessage', |
| 44 |
'type' => 'option', |
| 45 |
'sanitize_callback' => 'sanitize_text_field' |
| 46 |
) ) ); |
| 47 |
|
| 48 |
$wp_customize->add_setting( new WP_Customize_Setting( $wp_customize, 'loftloader_remove_settings', array( |
| 49 |
'default' => $loftloader_default_settings['loftloader_remove_settings'], |
| 50 |
'transport' => 'postMessage', |
| 51 |
'type' => 'option', |
| 52 |
'sanitize_callback' => 'loftloader_sanitize_checkbox' |
| 53 |
) ) ); |
| 54 |
|
| 55 |
$wp_customize->add_control( new LoftLoader_Customize_Control( $wp_customize, 'loftloader_max_load_time', array( |
| 56 |
'type' => 'number', |
| 57 |
'label' => esc_html__( 'Maximum Load Time', 'loftloader' ), |
| 58 |
'note_below' => esc_html__( 'Please enter any number greater than 0 to enable this feature.', 'loftloader' ), |
| 59 |
'section' => 'loftloader_section_max_load_time', |
| 60 |
'input_attrs' => array( 'min' => '0' ), |
| 61 |
'text' => esc_html__( ' second(s)', 'loftloader' ), |
| 62 |
'settings' => 'loftloader_max_load_time' |
| 63 |
) ) ); |
| 64 |
$wp_customize->add_control( new LoftLoader_Customize_Slider_Control( $wp_customize, 'loftloader_show_close_timer', array( |
| 65 |
'type' => 'slider', |
| 66 |
'label' => esc_html__( 'Show Close Button after', 'loftloader' ), |
| 67 |
'after_text' => 'second(s)', |
| 68 |
'input_attrs' => array( |
| 69 |
'data-default' => '15', |
| 70 |
'data-min' => '5', |
| 71 |
'data-max' => '20', |
| 72 |
'data-step' => '1' |
| 73 |
), |
| 74 |
'input_class' => 'loftloader-show-close-timer', |
| 75 |
'section' => 'loftloader_section_close_button', |
| 76 |
'settings' => 'loftloader_show_close_timer' |
| 77 |
) ) ); |
| 78 |
$wp_customize->add_control( new LoftLoader_Customize_Control( $wp_customize, 'loftloader_show_close_tip', array( |
| 79 |
'type' => 'text', |
| 80 |
'label' => esc_html__( 'Description for Close Button', 'loftloader' ), |
| 81 |
'section' => 'loftloader_section_close_button', |
| 82 |
'settings' => 'loftloader_show_close_tip' |
| 83 |
) ) ); |
| 84 |
|
| 85 |
$wp_customize->add_control( new LoftLoader_Customize_Control( $wp_customize, 'loftloader_remove_settings', array( |
| 86 |
'type' => 'check', |
| 87 |
'label' => esc_html__( 'Remove Plugin Data after Deactivating Plugin', 'loftloader' ), |
| 88 |
'description' => esc_html__( 'If checked, all settings will be removed after deactivating this plugin.', 'loftocean' ), |
| 89 |
'choices' => array( 'on' => '' ), |
| 90 |
'section' => 'loftloader_section_remove_settings', |
| 91 |
'settings' => 'loftloader_remove_settings' |
| 92 |
) ) ); |
| 93 |
} |
| 94 |
|