芝麻web文件管理V1.00
编辑当前文件:/home/disqkgca/aqanet.org/wp-content/plugins/carousel-slider/includes/Admin/Setting.php
'optimized', 'show_structured_data' => 'on', 'woocommerce_shop_loop_item_template' => 'v1-compatibility', ); $options = wp_parse_args( get_option( 'carousel_slider_settings', array() ), $default_args ); return $options[ $key ] ?? $default_value; } /** * Plugin setting fields * * @throws Exception It throws exception if you don't set name and id field. */ public function settings() { $settings = new DefaultSettingApi(); $settings->add_menu( array( 'page_title' => __( 'Carousel Slider Settings', 'carousel-slider' ), 'menu_title' => __( 'Settings', 'carousel-slider' ), 'about_text' => __( 'Thank you for choosing Carousel Slider. We hope you enjoy it!', 'carousel-slider' ), 'menu_slug' => 'settings', 'parent_slug' => 'edit.php?post_type=carousels', 'option_name' => 'carousel_slider_settings', ) ); // Add settings page tab. $settings->set_panel( array( 'id' => 'general', 'title' => __( 'General', 'carousel-slider' ), 'priority' => 10, ) ); $settings->set_panel( array( 'id' => 'woocommerce', 'title' => __( 'WooCommerce', 'carousel-slider' ), 'priority' => 20, ) ); $settings->add_field( array( 'id' => 'load_scripts', 'type' => 'radio', 'default' => 'optimized', 'title' => __( 'Style & Scrips', 'carousel-slider' ), 'description' => __( 'If you choose
Optimized
, then scrips and styles will be loaded only on page where you are using shortcode. If
Optimized
is not working for you then choose
Optimized with style loader
. Then it will add a small javascript at footer to load css file in header. If none of these is not working for you then choose
Always
', 'carousel-slider' ), 'choices' => array( 'optimized' => __( 'Optimized (recommended)', 'carousel-slider' ), 'optimized-loader' => __( 'Optimized with style loader', 'carousel-slider' ), 'always' => __( 'Always', 'carousel-slider' ), ), 'panel' => 'general', 'priority' => 10, ) ); $settings->add_field( array( 'id' => 'slider_js_package', 'type' => 'radio', 'default' => 'owl.carousel', 'title' => __( 'Slider JavaScript package', 'carousel-slider' ), 'description' => __( '
Swiper
, is the most modern mobile touch slider without any third party dependencies.
Owl Carousel 2
was great but now it is
PRETTY MUCH DEAD
as there is no development after Nov 12, 2018', 'carousel-slider' ), 'choices' => array( array( 'value' => 'owl.carousel', 'label' => __( 'Owl Carousel 2 + Magnific Popup', 'carousel-slider' ), ), array( 'value' => 'swiper', 'label' => __( 'Swiper (experimental)', 'carousel-slider' ), ), ), 'panel' => 'general', 'priority' => 20, ) ); $settings->add_field( array( 'id' => 'show_structured_data', 'type' => 'switch', 'default' => 'on', 'title' => __( 'Show Structured Data', 'carousel-slider' ), 'description' => __( 'If you enable to show, then it will generate structured data for every slider for better SEO. But if you are using some other SEO plugin to handle SEO, then you can disabled it.', 'carousel-slider' ), 'panel' => 'general', 'priority' => 30, ) ); $choices = array( array( 'value' => 'wc-default', 'label' => __( 'WooCommerce Default (recommended)', 'carousel-slider' ), ), array( 'value' => 'v1-compatibility', 'label' => __( 'Compatibility mode (with version 1)', 'carousel-slider' ), ), ); if ( Helper::is_pro_active() ) { $choices[] = array( 'value' => 'template-parser', 'label' => __( 'Custom Template (pro)', 'carousel-slider' ), ); } $settings->add_field( array( 'id' => 'woocommerce_shop_loop_item_template', 'type' => 'radio', 'default' => 'v1-compatibility', 'title' => __( 'Slider item template', 'carousel-slider' ), 'description' => array( __( '
WooCommerce Default
use hook to load shop loop template and does not allow hiding/showing title, rating, price, card button, sale tag using slider settings.', 'carousel-slider' ), __( '
Compatibility mode
use custom template and allow hiding/showing title, rating, price, card button, sale tag.', 'carousel-slider' ), ), 'choices' => $choices, 'panel' => 'woocommerce', ) ); } /** * Get modules choices * * @return array */ public function get_modules_choices(): array { $slider_types = Helper::get_slider_types(); $module_choices = array(); foreach ( $slider_types as $value => $option ) { $choice = array( 'value' => $value, 'label' => isset( $option['pro'] ) && true === $option['pro'] ? sprintf( '%s - pro', $option['label'] ) : $option['label'], ); if ( isset( $option['enabled'] ) && false === $option['enabled'] ) { $choice['readonly'] = true; } $module_choices[] = $choice; } return $module_choices; } }