| Server IP : 14.225.204.176 / Your IP : 216.73.216.6 Web Server : nginx/1.24.0 System : Linux nodejs-ybgk 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64 User : root ( 0) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/php/fe2tech/wp-content/themes/contio/elementor/core/register/ |
Upload File : |
<?php
// Post term options
$post_term_options = ct_get_grid_term_options('service');
$slides_to_show = range( 1, 10 );
$slides_to_show = array_combine( $slides_to_show, $slides_to_show );
// Register Post Carousel Widget
ct_add_custom_widget(
array(
'name' => 'ct_service_carousel',
'title' => esc_html__('Services Carousel', 'contio' ),
'icon' => 'eicon-tools',
'categories' => array( Case_Theme_Core::CT_CATEGORY_NAME ),
'scripts' => array(
'jquery-slick',
'ct-post-carousel-widget-js',
),
'params' => array(
'sections' => array(
array(
'name' => 'layout_section',
'label' => esc_html__('Layout', 'contio' ),
'tab' => \Elementor\Controls_Manager::TAB_LAYOUT,
'controls' => array(
array(
'name' => 'layout',
'label' => esc_html__('Templates', 'contio' ),
'type' => Case_Theme_Core::LAYOUT_CONTROL,
'default' => '1',
'options' => [
'1' => [
'label' => esc_html__('Layout 1', 'contio' ),
'image' => get_template_directory_uri() . '/elementor/templates/widgets/ct_service_carousel/layout-image/layout1.jpg'
],
'2' => [
'label' => esc_html__('Layout 2', 'contio' ),
'image' => get_template_directory_uri() . '/elementor/templates/widgets/ct_service_carousel/layout-image/layout2.jpg'
],
'3' => [
'label' => esc_html__('Layout 3', 'contio' ),
'image' => get_template_directory_uri() . '/elementor/templates/widgets/ct_service_carousel/layout-image/layout3.jpg'
],
],
),
),
),
array(
'name' => 'source_section',
'label' => esc_html__('Source', 'contio' ),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'controls' => array(
array(
'name' => 'thumbnail',
'type' => \Elementor\Group_Control_Image_Size::get_type(),
'control_type' => 'group',
'default' => 'custom',
),
array(
'name' => 'source',
'label' => esc_html__('Select Categories', 'contio' ),
'type' => \Elementor\Controls_Manager::SELECT2,
'multiple' => true,
'options' => $post_term_options,
),
array(
'name' => 'orderby',
'label' => esc_html__('Order By', 'contio' ),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => 'date',
'options' => [
'date' => esc_html__('Date', 'contio' ),
'ID' => esc_html__('ID', 'contio' ),
'author' => esc_html__('Author', 'contio' ),
'title' => esc_html__('Title', 'contio' ),
'rand' => esc_html__('Random', 'contio' ),
],
),
array(
'name' => 'order',
'label' => esc_html__('Sort Order', 'contio' ),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => 'desc',
'options' => [
'desc' => esc_html__('Descending', 'contio' ),
'asc' => esc_html__('Ascending', 'contio' ),
],
),
array(
'name' => 'limit',
'label' => esc_html__('Total items', 'contio' ),
'type' => \Elementor\Controls_Manager::NUMBER,
'default' => '6',
),
),
),
array(
'name' => 'display_section',
'label' => esc_html__('Display Options', 'contio' ),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'controls' => array(
array(
'name' => 'show_title',
'label' => esc_html__('Show Title', 'contio' ),
'type' => \Elementor\Controls_Manager::SWITCHER,
'default' => 'true',
),
array(
'name' => 'show_excerpt',
'label' => esc_html__('Show Excerpt', 'contio' ),
'type' => \Elementor\Controls_Manager::SWITCHER,
'default' => 'true',
'condition' => [
'layout' => '2',
],
),
array(
'name' => 'num_words',
'label' => esc_html__('Number of Words', 'contio' ),
'type' => \Elementor\Controls_Manager::NUMBER,
'default' => 25,
'condition' => [
'show_excerpt' => 'true',
],
'separator' => 'after',
),
array(
'name' => 'show_button',
'label' => esc_html__('Show Read More', 'contio' ),
'type' => \Elementor\Controls_Manager::SWITCHER,
'default' => 'true',
),
array(
'name' => 'button_text',
'label' => esc_html__('Read More Text', 'contio' ),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => esc_html__('Read more', 'contio'),
'condition' => [
'show_button' => 'true',
],
'separator' => 'after',
),
),
),
array(
'name' => 'section_carousel_settings',
'label' => esc_html__('Carousel', 'contio'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'controls' => array(
array(
'name' => 'ct_animate',
'label' => esc_html__('Case Animate', 'contio' ),
'type' => \Elementor\Controls_Manager::SELECT,
'options' => contio_animate(),
'default' => '',
),
array(
'name' => 'slides_to_show',
'label' => esc_html__('Slides to Show', 'contio'),
'type' => \Elementor\Controls_Manager::SELECT,
'control_type' => 'responsive',
'options' => [
'' => esc_html__('Default', 'contio' ),
] + $slides_to_show,
),
array(
'name' => 'slides_to_scroll',
'label' => esc_html__('Slides to Scroll', 'contio'),
'type' => \Elementor\Controls_Manager::SELECT,
'control_type' => 'responsive',
'options' => [
'' => esc_html__('Default', 'contio' ),
] + $slides_to_show,
'condition' => [
'slides_to_show' => '1',
],
),
array(
'name' => 'arrows',
'label' => esc_html__('Show Arrows', 'contio'),
'type' => \Elementor\Controls_Manager::SWITCHER,
'default' => 'false',
),
array(
'name' => 'dots',
'label' => esc_html__('Show Dots', 'contio'),
'type' => \Elementor\Controls_Manager::SWITCHER,
'default' => 'false',
),
array(
'name' => 'pause_on_hover',
'label' => esc_html__('Pause on Hover', 'contio'),
'type' => \Elementor\Controls_Manager::SWITCHER,
'default' => 'false',
),
array(
'name' => 'autoplay',
'label' => esc_html__('Autoplay', 'contio'),
'type' => \Elementor\Controls_Manager::SWITCHER,
'default' => 'false',
),
array(
'name' => 'autoplay_speed',
'label' => esc_html__('Autoplay Speed', 'contio'),
'type' => \Elementor\Controls_Manager::NUMBER,
'default' => 5000,
'condition' => [
'autoplay' => 'true'
]
),
array(
'name' => 'infinite',
'label' => esc_html__('Infinite Loop', 'contio'),
'type' => \Elementor\Controls_Manager::SWITCHER,
'default' => 'false',
),
array(
'name' => 'speed',
'label' => esc_html__('Animation Speed', 'contio'),
'type' => \Elementor\Controls_Manager::NUMBER,
'default' => 500,
),
),
),
),
),
),
get_template_directory() . '/elementor/core/widgets/'
);