subtab_init(); $this->form_messages = array( 'success_message' => __( 'Image Caption Settings successfully saved.', 'a3-responsive-slider' ), 'error_message' => __( 'Error: Image Caption Settings can not save.', 'a3-responsive-slider' ), 'reset_message' => __( 'Image Caption Settings successfully reseted.', 'a3-responsive-slider' ), ); add_action( $this->plugin_name . '-' . $this->form_key . '_settings_end', array( $this, 'include_script' ) ); add_action( $this->plugin_name . '_set_default_settings' , array( $this, 'set_default_settings' ) ); add_action( $this->plugin_name . '-' . $this->form_key . '_settings_init' , array( $this, 'reset_default_settings' ) ); //add_action( $this->plugin_name . '_get_all_settings' , array( $this, 'get_settings' ) ); add_action( $this->plugin_name . '-'. $this->form_key.'_settings_start', array( $this, 'pro_fields_before' ) ); add_action( $this->plugin_name . '-'. $this->form_key.'_settings_end', array( $this, 'pro_fields_after' ) ); } /*-----------------------------------------------------------------------------------*/ /* subtab_init() */ /* Sub Tab Init */ /*-----------------------------------------------------------------------------------*/ public function subtab_init() { add_filter( $this->plugin_name . '-' . $this->parent_tab . '_settings_subtabs_array', array( $this, 'add_subtab' ), $this->position ); } /*-----------------------------------------------------------------------------------*/ /* set_default_settings() /* Set default settings with function called from Admin Interface */ /*-----------------------------------------------------------------------------------*/ public function set_default_settings() { global $a3_responsive_slider_admin_interface; $a3_responsive_slider_admin_interface->reset_settings( $this->form_fields, $this->option_name, false ); } /*-----------------------------------------------------------------------------------*/ /* reset_default_settings() /* Reset default settings with function called from Admin Interface */ /*-----------------------------------------------------------------------------------*/ public function reset_default_settings() { global $a3_responsive_slider_admin_interface; $a3_responsive_slider_admin_interface->reset_settings( $this->form_fields, $this->option_name, true, true ); } /*-----------------------------------------------------------------------------------*/ /* get_settings() /* Get settings with function called from Admin Interface */ /*-----------------------------------------------------------------------------------*/ public function get_settings() { global $a3_responsive_slider_admin_interface; $a3_responsive_slider_admin_interface->get_settings( $this->form_fields, $this->option_name ); } /** * subtab_data() * Get SubTab Data * ============================================= * array ( * 'name' => 'my_subtab_name' : (required) Enter your subtab name that you want to set for this subtab * 'label' => 'My SubTab Name' : (required) Enter the subtab label * 'callback_function' => 'my_callback_function' : (required) The callback function is called to show content of this subtab * ) * */ public function subtab_data() { $subtab_data = array( 'name' => 'caption', 'label' => __( 'Image Caption', 'a3-responsive-slider' ), 'callback_function' => 'a3_responsive_sider_template_mobile_caption_settings_form', ); if ( $this->subtab_data ) return $this->subtab_data; return $this->subtab_data = $subtab_data; } /*-----------------------------------------------------------------------------------*/ /* add_subtab() */ /* Add Subtab to Admin Init /*-----------------------------------------------------------------------------------*/ public function add_subtab( $subtabs_array ) { if ( ! is_array( $subtabs_array ) ) $subtabs_array = array(); $subtabs_array[] = $this->subtab_data(); return $subtabs_array; } /*-----------------------------------------------------------------------------------*/ /* settings_form() */ /* Call the form from Admin Interface /*-----------------------------------------------------------------------------------*/ public function settings_form() { global $a3_responsive_slider_admin_interface; $output = ''; $output .= $a3_responsive_slider_admin_interface->admin_forms( $this->form_fields, $this->form_key, $this->option_name, $this->form_messages ); return $output; } /*-----------------------------------------------------------------------------------*/ /* init_form_fields() */ /* Init all fields of this form */ /*-----------------------------------------------------------------------------------*/ public function init_form_fields() { // Define settings $this->form_fields = apply_filters( $this->option_name . '_settings_fields', array( array( 'name' => __( 'Image Caption Settings', 'a3-responsive-slider' ), 'type' => 'heading', ), array( 'name' => __( 'Caption', 'a3-responsive-slider' ), 'id' => 'enable_slider_caption', 'class' => 'enable_slider_caption', 'type' => 'onoff_checkbox', 'default' => 1, 'checked_value' => 1, 'unchecked_value' => 0, 'checked_label' => __( 'ON', 'a3-responsive-slider' ), 'unchecked_label' => __( 'OFF', 'a3-responsive-slider' ), ), array( 'type' => 'heading', 'class' => 'slider_caption_container' ), array( 'name' => __( 'Caption Margin', 'a3-responsive-slider' ), 'id' => 'caption_margin', 'type' => 'array_textfields', 'ids' => array( array( 'id' => 'caption_margin_top', 'name' => __( 'Top', 'a3-responsive-slider' ), 'css' => 'width:40px;', 'default' => 10 ), array( 'id' => 'caption_margin_bottom', 'name' => __( 'Bottom', 'a3-responsive-slider' ), 'css' => 'width:40px;', 'default' => 5 ), array( 'id' => 'caption_margin_left', 'name' => __( 'Left', 'a3-responsive-slider' ), 'css' => 'width:40px;', 'default' => 10 ), array( 'id' => 'caption_margin_right', 'name' => __( 'Right', 'a3-responsive-slider' ), 'css' => 'width:40px;', 'default' => 10 ), ) ), array( 'name' => __( 'Caption Lenght', 'a3-responsive-slider' ), 'desc' => __( 'characters', 'a3-responsive-slider' ), 'id' => 'caption_lenght', 'type' => 'text', 'default' => 200, 'css' => 'width:60px;' ), array( 'name' => __( 'Caption Font', 'a3-responsive-slider' ), 'id' => 'caption_font', 'type' => 'typography', 'default' => array( 'size' => '12px', 'line_height' => '1.4em', 'face' => 'Arial, sans-serif', 'style' => 'normal', 'color' => '#666666' ) ), )); } public function include_script() { ?> settings_form(); } ?>