id = 'wp360view_settings'; $this->label = __( "360 View Settings", '360-product-viewer-for-woocommerce' ); add_filter( 'woocommerce_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); add_action( 'woocommerce_settings_' . $this->id, array( $this, 'output' ) ); add_action( 'woocommerce_settings_save_' . $this->id, array( $this, 'save' ) ); add_action( 'woocommerce_sections_' . $this->id, array( $this, 'output_sections' ) ); } /** * Get sections * * @return array */ public function get_sections() { $sections = array( 'ad_general_settings' => __( 'Shortcode Settings', '360-product-viewer-for-woocommerce' ), ); return apply_filters( 'woocommerce_get_sections_' . $this->id, $sections ); } /** * Get settings array. * * @return array */ public function get_settings($current_section = '') { $settings = array(); if( '' == $current_section ) $current_section = 'ad_general_settings'; if ( 'ad_general_settings' == $current_section ) { $settings = apply_filters( 'wp360view_section_ad_general_settings', array( array( 'title' => __( 'Advance Settings', '360-product-viewer-for-woocommerce' ), 'type' => 'title', 'id' => 'wp360view' ), array( 'default' => 'true', 'show_if_checked' => 'true', 'type' => 'checkbox', 'id' => 'navigation', 'name' => __( 'Enable Navigation', '360-product-viewer-for-woocommerce' ), 'class' => 'wc-ro-wp360view', 'desc' => __( 'Enable Navigation Panel', '360-product-viewer-for-woocommerce' ), 'desc_tip' => __( 'Enable or disable navigation panel globally OR you can override this settings by "navigation" attribute by shortcode. Default value is true.', '360-product-viewer-for-woocommerce' ), ), array( 'default' => 'true', 'show_if_checked' => 'true', 'type' => 'checkbox', 'id' => 'drag', 'name' => __( 'Enable dragging', '360-product-viewer-for-woocommerce' ), 'class' => 'wc-ro-wp360view', 'desc' => __( 'Enable Dragging', '360-product-viewer-for-woocommerce' ), 'desc_tip' => __( 'Enable or disable dragging option globally OR you can override this settings by "drag" attribute by shortcode. Default value is true.', '360-product-viewer-for-woocommerce' ), ), array( 'title' => __( 'Play Speed Timing', '360-product-viewer-for-woocommerce' ), 'id' => 'playspeed', 'type' => 'text', 'default' => "100", 'placeholder' => __( 'Play Speed Timing', '360-product-viewer-for-woocommerce' ), 'desc' => __( 'Value to control the speed (in milliseconds) of play button rotation.', '360-product-viewer-for-woocommerce' ), 'desc_tip' => __( 'Add/change play speed of 360 slider globally OR you can override this settings by "playspeed" attribute by shortcode. Default value is 100.', '360-product-viewer-for-woocommerce' ), ), array( 'title' => __( 'Frame Rate', '360-product-viewer-for-woocommerce' ), 'id' => 'framerate', 'type' => 'text', 'default' => "10", 'placeholder' => __( 'Frame Rate', '360-product-viewer-for-woocommerce' ), 'desc' => __( 'It refers to the number of frames displayed per second when rendering a 360-degree view.', '360-product-viewer-for-woocommerce' ), 'desc_tip' => __( 'Add/change frame rate of 360 slider globally OR you can override this settings by "framerate" attribute by shortcode. Default value is 10.', '360-product-viewer-for-woocommerce' ), ), array( 'default' => 'false', 'show_if_checked' => 'true', 'type' => 'checkbox', 'id' => 'enablespin', 'name' => __( 'Enable Auto Spin', '360-product-viewer-for-woocommerce' ), 'class' => 'wc-ro-wp360view', 'desc' => __( 'Enable Spin', '360-product-viewer-for-woocommerce' ), 'desc_tip' => __( 'Enable or disable auto spin settings globally OR you can override this settings by "enablespin" attribute by shortcode. Default value is false.', '360-product-viewer-for-woocommerce' ), ), array( 'default' => 'false', 'show_if_checked' => 'true', 'type' => 'checkbox', 'id' => 'showcursor', 'name' => __( 'Show Cursor', '360-product-viewer-for-woocommerce' ), 'class' => 'wc-ro-wp360view', 'desc' => __( 'Show Cursor', '360-product-viewer-for-woocommerce' ), 'desc_tip' => __( 'Hide or show cursor globally OR you can override this settings by "showcursor" attribute by shortcode. Default value is false.', '360-product-viewer-for-woocommerce' ), ), array( 'default' => 'true', 'show_if_checked' => 'true', 'type' => 'checkbox', 'id' => 'fullscreen', 'name' => __( 'Fullscreen', '360-product-viewer-for-woocommerce' ), 'class' => 'wc-ro-wp360view', 'desc' => __( 'Enable Full Screen Support', '360-product-viewer-for-woocommerce' ), 'desc_tip' => __( 'Enable or disable full screen support settings globally OR you can override this settings by "fullscreen" attribute by shortcode. Default value is true.', '360-product-viewer-for-woocommerce' ), ), array( 'default' => 'true', 'show_if_checked' => 'true', 'type' => 'checkbox', 'id' => 'zoominout', 'name' => __( 'Zoom In/Out', '360-product-viewer-for-woocommerce' ), 'class' => 'wc-ro-wp360view', 'desc' => __( 'Enable Zoom In/Out', '360-product-viewer-for-woocommerce' ), 'desc_tip' => __( 'Enable or disable zoom in/out settings globally OR you can override this settings by "zoominout" attribute by shortcode. Default value is true', '360-product-viewer-for-woocommerce' ), ), array( 'type' => 'sectionend', 'id' => 'settings_config' ), ) ); } return apply_filters( 'woocommerce_get_settings_' . $this->id, $settings, $current_section ); } /** * Output the settings * * @since 1.0 */ public function output() { global $current_section; $settings = $this->get_settings( $current_section ); \WC_Admin_Settings::output_fields( $settings ); } /** * Save settings * * @since 1.0 */ public function save() { global $current_section,$wp_query; $settings = $this->get_settings( $current_section ); \WC_Admin_Settings::save_fields( $settings ); } /** * Print messages * * @since 1.0 */ public function print_message() { ?>
print_message ); ?>