| 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('portfolio');
// Register Post Grid Widget
ct_add_custom_widget(
array(
'name' => 'ct_portfolio_grid',
'title' => esc_html__('Portfolio Grid', 'contio' ),
'icon' => 'eicon-posts-justified',
'categories' => array( Case_Theme_Core::CT_CATEGORY_NAME ),
'scripts' => [
'imagesloaded',
'isotope',
'ct-post-masonry-widget-js',
'ct-post-grid-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_portfolio_grid/layout-image/layout1.jpg'
],
'2' => [
'label' => esc_html__('Layout 2', 'contio' ),
'image' => get_template_directory_uri() . '/elementor/templates/widgets/ct_portfolio_grid/layout-image/layout2.jpg'
],
],
),
),
),
array(
'name' => 'source_section',
'label' => esc_html__('Source', 'contio' ),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'controls' => array(
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' => '8',
),
),
),
array(
'name' => 'grid_section',
'label' => esc_html__('Grid', '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' => 'thumbnail',
'type' => \Elementor\Group_Control_Image_Size::get_type(),
'control_type' => 'group',
'default' => 'custom',
'condition' => [
'layout' => '1',
],
),
array(
'name' => 'filter',
'label' => esc_html__('Filter on Masonry', 'contio' ),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => 'false',
'options' => [
'true' => esc_html__('Enable', 'contio' ),
'false' => esc_html__('Disable', 'contio' ),
],
),
array(
'name' => 'filter_default_title',
'label' => esc_html__('Filter Default Title', 'contio' ),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => esc_html__('All', 'contio' ),
'condition' => [
'filter' => 'true',
],
),
array(
'name' => 'filter_alignment',
'label' => esc_html__('Filter Alignment', 'contio' ),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => 'center',
'options' => [
'center' => esc_html__('Center', 'contio' ),
'left' => esc_html__('Left', 'contio' ),
'right' => esc_html__('Right', 'contio' ),
],
'condition' => [
'filter' => 'true',
],
),
array(
'name' => 'pagination_type',
'label' => esc_html__('Pagination Type', 'contio' ),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => 'false',
'options' => [
'pagination' => esc_html__('Pagination', 'contio' ),
'loadmore' => esc_html__('Loadmore', 'contio' ),
'false' => esc_html__('Disable', 'contio' ),
],
),
array(
'name' => 'col_xs',
'label' => esc_html__('Columns XS Devices', 'contio' ),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => '1',
'options' => [
'1' => esc_html__('1', 'contio' ),
'2' => esc_html__('2', 'contio' ),
'3' => esc_html__('3', 'contio' ),
'4' => esc_html__('4', 'contio' ),
'6' => esc_html__('6', 'contio' ),
],
),
array(
'name' => 'col_sm',
'label' => esc_html__('Columns SM Devices', 'contio' ),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => '2',
'options' => [
'1' => esc_html__('1', 'contio' ),
'2' => esc_html__('2', 'contio' ),
'3' => esc_html__('3', 'contio' ),
'4' => esc_html__('4', 'contio' ),
'6' => esc_html__('6', 'contio' ),
],
),
array(
'name' => 'col_md',
'label' => esc_html__('Columns MD Devices', 'contio' ),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => '3',
'options' => [
'1' => esc_html__('1', 'contio' ),
'2' => esc_html__('2', 'contio' ),
'3' => esc_html__('3', 'contio' ),
'4' => esc_html__('4', 'contio' ),
'6' => esc_html__('6', 'contio' ),
],
),
array(
'name' => 'col_lg',
'label' => esc_html__('Columns LG Devices', 'contio' ),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => '4',
'options' => [
'1' => esc_html__('1', 'contio' ),
'2' => esc_html__('2', 'contio' ),
'3' => esc_html__('3', 'contio' ),
'4' => esc_html__('4', 'contio' ),
'6' => esc_html__('6', 'contio' ),
],
),
array(
'name' => 'col_xl',
'label' => esc_html__('Columns XL Devices', 'contio' ),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => '4',
'options' => [
'1' => esc_html__('1', 'contio' ),
'2' => esc_html__('2', 'contio' ),
'3' => esc_html__('3', 'contio' ),
'4' => esc_html__('4', 'contio' ),
'6' => esc_html__('6', 'contio' ),
],
),
),
),
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' => 'title_tag',
'label' => esc_html__('HTML Tag', 'contio'),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => 'h3',
'options' => [
'h1' => 'H1',
'h2' => 'H2',
'h3' => 'H3',
'h4' => 'H4',
'h5' => 'H5',
'h6' => 'H6',
],
'condition' => [
'show_title' => 'true'
],
'separator' => 'after',
),
array(
'name' => 'show_button',
'label' => esc_html__('Show Read More', 'contio' ),
'type' => \Elementor\Controls_Manager::SWITCHER,
'default' => 'true',
'condition' => [
'layout' => '1',
'layout' => '2',
],
),
),
),
),
),
),
get_template_directory() . '/elementor/core/widgets/'
);