Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
home
/
getwphos
/
public_html
/
wastefull
/
wp-content
/
themes
/
wastia
/
elementor
/
core
/
File Content:
elementor.php
<?php use Elementor\Controls_Manager; // Register Elementor Widgets through plugin core if (!function_exists('wastia_elementor_register_widgets')) { add_filter('etc_register_widgets', 'wastia_elementor_register_widgets'); function wastia_elementor_register_widgets($widgets) { $widgets = [ [ // Cms Accordion 'name' => 'cms_accordion', 'title' => esc_html__('CMS Accordion', 'wastia'), 'icon' => 'eicon-accordion', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => array( 'cms-accordion-widget-js', ), 'keywords' => [ 'wastia', 'cms accordion', 'accordion' ] ], [ // Cms Anchor Link 'name' => 'cms_anchor', 'title' => esc_html__('CMS Anchor', 'wastia'), 'icon' => 'eicon-menu-bar', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'cms anchor', 'anchor' ] ], [ // Cms Banner 'name' => 'cms_banner', 'title' => esc_html__('CMS Banner', 'wastia'), 'icon' => 'eicon-banner', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'banner', 'image' ] ], [ // Cms Blog 'name' => 'cms_blog', 'title' => esc_html__('CMS Blog', 'wastia'), 'icon' => 'eicon-posts-grid', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => [ 'imagesloaded', 'isotope', 'cms-post-grid-widget-js', ], 'keywords' => [ 'wastia', 'blog', 'post', 'grid' ] ], [ // Cms Blog Grid 'name' => 'cms_blog_grid', 'title' => esc_html__('CMS Blog Grid', 'wastia'), 'icon' => 'eicon-posts-grid', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => [ 'imagesloaded', 'isotope', 'cms-post-grid-widget-js', ], 'keywords' => [ 'wastia', 'blog', 'post', 'grid' ] ], [ // Cms Blog Carousel 'name' => 'cms_blog_carousel', 'title' => esc_html__('CMS Blog Carousel', 'wastia'), 'icon' => 'eicon-posts-carousel', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => [ 'swiper', 'cms-post-carousel-widget-js' ], 'styles' => [ 'swiper' ], 'keywords' => [ 'wastia', 'blog', 'post', 'carousel' ] ], [ // Cms Breadcrumb 'name' => 'cms_breadcrumb', 'title' => esc_html__('CMS Breadcrumb', 'wastia'), 'icon' => 'eicon-ellipsis-h', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'breadcrumb' ] ], [ // Cms Button 'name' => 'cms_button', 'title' => esc_html__('CMS Button', 'wastia'), 'icon' => 'eicon-button', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'cms button', 'button' ] ], [ // CMS Chart 'name' => 'cms_chart', 'title' => esc_html__('CMS Chart', 'wastia'), 'icon' => 'eicon-circle-o', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'cms chart', 'chart', 'chartjs' ], 'scripts' => array( 'chartjs', 'cms-chartjs' ) ], [ // Cms Clients Carousel 'name' => 'cms_clients', 'title' => esc_html__('CMS Clients', 'wastia'), 'icon' => 'eicon-person', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => [ 'swiper', 'cms-post-carousel-widget-js', ], 'styles' => [ 'swiper' ], 'keywords' => [ 'cms', 'wastia', 'client', 'clients', 'carousel' ] ], [ // Cms Copyright 'name' => 'cms_copyright', 'title' => esc_html__('CMS Copyright', 'wastia'), 'icon' => 'eicon-menu-bar', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'cms copyright', 'copyright' ] ], [ // Cms Countdown 'name' => 'cms_countdown', 'title' => esc_html__('CMS Countdown', 'wastia'), 'icon' => 'eicon-countdown', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => [ 'cms-countdown-config' ], 'keywords' => [ 'wastia', 'cms countdown', 'countdown' ] ], [ // Cms Counter 'name' => 'cms_counter', 'title' => esc_html__('CMS Counter', 'wastia'), 'icon' => 'eicon-counter-circle', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => array( 'jquery-numerator', 'cms-counter-widget-js', 'swiper', 'cms-post-carousel-widget-js' ), 'styles' => [ 'swiper' ], 'keywords' => [ 'wastia', 'cms counter', 'counter' ] ], [ // Cms Counter Sticky 'name' => 'cms_counter_sticky', 'title' => esc_html__('CMS Counter Sticky', 'wastia'), 'icon' => 'eicon-counter-circle', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => array( 'jquery-numerator', 'cms-counter-sticky-widget-js', 'cms-counter-widget-js' ), 'keywords' => [ 'wastia', 'cms counter', 'counter', 'sticky' ] ], [ // Cms Call to Action 'name' => 'cms_cta', 'title' => esc_html__('CMS Call To Action', 'wastia'), 'icon' => 'eicon-image-rollover', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'cms', 'call action', 'call', 'button' ] ], [ // CMS Download 'name' => 'cms_download', 'title' => esc_html__('CMS Download', 'wastia'), 'icon' => 'eicon-anchor', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'cms download', 'download', 'document' ] ], [ // Cms Fancy Box 'name' => 'cms_fancy_box', 'title' => esc_html__('CMS Fancy Box', 'wastia'), 'icon' => 'eicon-icon-box', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => [], 'styles' => [], 'keywords' => [ 'wastia', 'fancy-box', 'fancy', 'box' ] ], [ // CMS Find Location 'name' => 'cms_find_location', 'title' => esc_html__('CMS Find Location', 'wastia'), 'icon' => 'eicon-search-results', // eicon-map-pin / eicon-site-search 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'cms location', 'location', 'find','map', ] ], [ // CMS Gallery 'name' => 'cms_gallery', 'title' => esc_html__('CMS Gallery', 'wastia'), 'icon' => 'eicon-gallery-grid', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'cms gallery', 'gallery', 'image', ], 'scripts' => [ 'cms-galleries' ] ], [ // CMS Gallery Carousel 'name' => 'cms_gallery_carousel', 'title' => esc_html__('CMS Gallery Carousel', 'wastia'), 'icon' => 'eicon-posts-carousel', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'cms gallery', 'gallery', 'image', 'carousel' ], 'scripts' => [ 'swiper', 'cms-post-carousel-widget-js' ], 'styles' => [ 'swiper' ], ], [ // CMS Google Map 'name' => 'cms_google_map', 'title' => esc_html__('CMS Google Map', 'wastia'), 'icon' => 'eicon-google-maps', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'cms map', 'cms', 'map' ] ], [ // Cms Heading 'name' => 'cms_heading', 'title' => esc_html__('CMS Heading', 'wastia'), 'icon' => 'eicon-heading', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'heading', 'custom heading' ] ], [ // Cms How it Work 'name' => 'cms_howitwork', 'title' => esc_html__('CMS How It Work', 'wastia'), 'icon' => 'eicon-info-box', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => [ 'cms-howitwork' ], 'keywords' => [ 'wastia', 'how', 'how it work' ] ], [ // Cms Icon 'name' => 'cms_icon', 'title' => esc_html__('CMS Icon', 'wastia'), 'icon' => 'eicon-alert', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'cms icon', 'icon' ] ], [ // Cms List 'name' => 'cms_list', 'title' => esc_html__('CMS List', 'wastia'), 'icon' => 'eicon-editor-list-ul', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'cms list', 'list' ] ], [ // Cms Maps Pointers 'name' => 'cms_maps_pointers', 'title' => esc_html__('CMS Maps Pointers', 'wastia'), 'icon' => 'eicon-map-pin', //eicon-google-maps 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'cms map pointer', 'map', 'pointer' ] ], [ // Cms Navigation Menu 'name' => 'cms_navigation_menu', 'title' => esc_html__('CMS Menu', 'wastia'), 'icon' => 'eicon-menu-bar', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'cms navigation menu', 'menu' ] ], [ // Cms Page Title 'name' => 'cms_page_title', 'title' => esc_html__('CMS Page Title', 'wastia'), 'icon' => 'eicon-archive-title', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'cms page title', 'page title', 'title' ] ], [ // Cms Pricing 'name' => 'cms_pricing', 'title' => esc_html__('CMS Pricing', 'wastia'), 'icon' => 'eicon-price-table', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => [ 'swiper', 'cms-post-carousel-widget-js', ], 'styles' => [ 'swiper' ], 'keywords' => [ 'wastia', 'cms pricing', 'pricing', 'price' ] ], [ // Cms Process 'name' => 'cms_process', 'title' => esc_html__('CMS Process', 'wastia'), 'icon' => 'eicon-counter-circle', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => [ 'swiper', 'cms-post-carousel-widget-js', ], 'styles' => [ 'swiper' ], 'keywords' => [ 'wastia', 'cms process', 'process' ] ], [ // Cms Progress Bar 'name' => 'cms_progressbar', 'title' => esc_html__('CMS Progress Bar', 'wastia'), 'icon' => 'eicon-skill-bar', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => [ 'jquery-numerator', 'cms-progressbar-widget-js', ], 'keywords' => [ 'wastia', 'cms progressbar', 'progress bar' ] ], [ // CMS Quick Contact 'name' => 'cms_quickcontact', 'title' => esc_html__('CMS Quick Contact', 'wastia'), 'icon' => 'eicon-mail', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'cms quick contact', 'quick', 'contact', ] ], [ // Cms Single Image 'name' => 'cms_single_image', 'title' => esc_html__('CMS Single Image', 'wastia'), 'icon' => 'eicon-info-box', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'cms single image', 'image' ] ], [ // Cms Slider 'name' => 'cms_slider', 'title' => esc_html__('CMS Slider', 'wastia'), 'icon' => 'eicon-slides', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => [ 'swiper', 'cms-post-carousel-widget-js', ], 'styles' => [ 'swiper' ], 'keywords' => [ 'wastia', 'cms slider', 'slider' ] ], [ // CMS Socials Icons 'name' => 'cms_social_icons', 'title' => esc_html__('CMS Socials Icon', 'wastia'), 'icon' => 'eicon-social-icons', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'cms social', 'icon', 'social icon', ] ], [ // CMS Star Rating 'name' => 'cms_star_rating', 'title' => esc_html__('CMS Star Ratings', 'wastia'), 'icon' => 'eicon-rating', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'cms rating', 'rating', 'star', ] ], [ // CMS Support 'name' => 'cms_support', 'title' => esc_html__('CMS Support', 'wastia'), 'icon' => 'eicon-person', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'cms support', 'support', 'hel', 'call center' ] ], [ // Cms Tabs 'name' => 'cms_tabs', 'title' => esc_html__('CMS Tabs', 'wastia'), 'icon' => 'eicon-tabs', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => [ 'cms-tabs-widget-js', ], 'keywords' => [ 'cms', 'wastia', 'tab' ] ], [ // Cms Teams (Grid + Carousel) 'name' => 'cms_teams', 'title' => esc_html__('CMS Teams', 'wastia'), 'icon' => 'eicon-user-circle-o', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => [ 'swiper', 'cms-post-carousel-widget-js', ], 'styles' => [ 'swiper' ], 'keywords' => [ 'cms', 'wastia', 'team', 'teams', 'grid', 'carousel' ] ], [ // Cms Testimonial Carousel 'name' => 'cms_testimonials', 'title' => esc_html__('CMS Testimonials', 'wastia'), 'icon' => 'eicon-testimonial', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => [ 'swiper', 'cms-post-carousel-widget-js', ], 'styles' => [ 'swiper' ], 'keywords' => [ 'cms', 'wastia', 'testimonial', 'testimonials', 'carousel' ] ], [ // Cms Video 'name' => 'cms_video_player', 'title' => esc_html__('CMS Video Player', 'wastia'), 'icon' => 'eicon-play', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'cms video player', 'video' ] ] ]; if(apply_filters('wastia_enable_service', true)){ $widgets[] = [ // Cms Service Grid 'name' => 'cms_service_grid', 'title' => esc_html__('CMS Service Grid', 'wastia'), 'icon' => 'eicon-posts-grid', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => [ 'imagesloaded', 'isotope', 'cms-post-grid-widget-js', ], 'keywords' => [ 'wastia', 'service', 'grid' ] ]; $widgets[] = [ // Cms Service Carousel 'name' => 'cms_service_carousel', 'title' => esc_html__('CMS Service Carousel', 'wastia'), 'icon' => 'eicon-posts-carousel', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => [ 'swiper', 'cms-post-carousel-widget-js', ], 'styles' => [ 'swiper' ], 'keywords' => [ 'wastia', 'service', 'carousel' ] ]; } if(apply_filters('wastia_enable_industry', true)){ $widgets[] = [ // Cms Industry Grid 'name' => 'cms_industry_grid', 'title' => esc_html__('CMS Industry Grid', 'wastia'), 'icon' => 'eicon-posts-grid', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => [ 'imagesloaded', 'isotope', 'cms-post-grid-widget-js', ], 'keywords' => [ 'wastia', 'industry', 'grid' ] ]; $widgets[] = [ // Cms Industry Carousel 'name' => 'cms_industry_carousel', 'title' => esc_html__('CMS Industry Carousel', 'wastia'), 'icon' => 'eicon-posts-carousel', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => [ 'swiper', 'cms-post-carousel-widget-js', ], 'styles' => [ 'swiper' ], 'keywords' => [ 'wastia', 'industry', 'carousel' ] ]; } if(apply_filters('wastia_enable_case', true)){ $widgets[] = [ // Cms Case 'name' => 'cms_case', 'title' => esc_html__('CMS Case', 'wastia'), 'icon' => 'eicon-posts-masonry', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'keywords' => [ 'wastia', 'case', 'grid' ] ]; $widgets[] = [ // Cms Case Grid 'name' => 'cms_case_grid', 'title' => esc_html__('CMS Case Grid', 'wastia'), 'icon' => 'eicon-posts-grid', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => [ 'imagesloaded', 'isotope', 'cms-post-grid-widget-js', ], 'keywords' => [ 'wastia', 'case', 'grid' ] ]; $widgets[] = [ // Cms Case Carousel 'name' => 'cms_case_carousel', 'title' => esc_html__('CMS Case Carousel', 'wastia'), 'icon' => 'eicon-posts-carousel', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => [ 'swiper', 'cms-post-carousel-widget-js', ], 'styles' => [ 'swiper' ], 'keywords' => [ 'wastia', 'case', 'carousel' ] ]; } if(apply_filters('wastia_enable_career', true)){ $widgets[] = [ // Cms Career Grid 'name' => 'cms_career_grid', 'title' => esc_html__('CMS Career Grid', 'wastia'), 'icon' => 'eicon-posts-grid', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => [ 'imagesloaded', 'isotope', 'cms-post-grid-widget-js', ], 'keywords' => [ 'wastia', 'career', 'grid' ] ]; $widgets[] = [ // Cms Career Carousel 'name' => 'cms_career_carousel', 'title' => esc_html__('CMS Career Carousel', 'wastia'), 'icon' => 'eicon-posts-carousel', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => [ 'swiper', 'cms-post-carousel-widget-js', ], 'styles' => [ 'swiper' ], 'keywords' => [ 'wastia', 'career', 'carousel' ] ]; } // Contact Form 7 if (class_exists('WPCF7')) { $widgets[] = [ 'name' => 'cms_contact_form', 'title' => esc_html__('CMS Contact Form 7', 'wastia'), 'icon' => 'eicon-form-horizontal', 'categories' => array(Elementor_Theme_Core::ETC_CATEGORY_NAME), 'scripts' => [], 'styles' => [], 'keywords' => [ 'cms', 'wastia', 'contact-form', 'form', 'contact' ] ]; } // Newsletter if(class_exists('Newsletter')){ $widgets[] = [ 'name' => 'cms_newsletter', 'title' => esc_html__( 'CMS Newsletter', 'wastia' ), 'icon' => 'eicon-mail', 'categories' => array( Elementor_Theme_Core::ETC_CATEGORY_NAME ), 'keywords' => [ 'cms', 'wastia', 'newsletter' ] ]; } // Language Swicther if(class_exists('TRP_Translate_Press')){ $widgets[] = [ 'name' => 'cms_language_switcher', 'title' => esc_html__( 'CMS Language Switcher', 'wastia' ), 'icon' => 'eicon-exchange', 'categories' => array( Elementor_Theme_Core::ETC_CATEGORY_NAME ), 'keywords' => [ 'cms', 'wastia', 'language', 'language switcher' ] ]; } // WooCommerce if(class_exists('WooCommerce')){ $widgets[] = [ 'name' => 'cms_product_tabs', 'title' => esc_html__( 'CMS Products Tab', 'wastia' ), 'icon' => 'eicon-product-tabs', 'categories' => array( Elementor_Theme_Core::ETC_CATEGORY_NAME ), 'keywords' => [ 'cms', 'wastia','tab', 'product', 'product tab' ], 'scripts' => [ 'cms-tabs-widget-js' ] ]; } return $widgets; } } if(!function_exists('wastia_add_hidden_device_controls')){ function wastia_add_hidden_device_controls($widget = [], $args = []) { $args = wp_parse_args($args, [ 'prefix' => 'cms_', 'condition' => [] ]); // The 'Hide On X' controls are displayed from largest to smallest, while the method returns smallest to largest. $active_devices = \Elementor\Plugin::$instance->breakpoints->get_active_devices_list( [ 'reverse' => true ] ); $active_breakpoints = \Elementor\Plugin::$instance->breakpoints->get_active_breakpoints(); foreach ( $active_devices as $breakpoint_key ) { $label = 'desktop' === $breakpoint_key ? esc_html__( 'Desktop', 'wastia' ) : $active_breakpoints[ $breakpoint_key ]->get_label(); $widget->add_control( $args['prefix'].'hide_' . $breakpoint_key, [ /* translators: %s: Device name. */ 'label' => sprintf( __( 'Hide On %s', 'wastia' ), $label ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => '', //'prefix_class' => 'elementor-', 'label_on' => esc_html__( 'Hide', 'wastia' ), 'label_off' => esc_html__( 'Show', 'wastia' ), //'return_value' => 'hidden-' . $breakpoint_key, 'condition' => $args['condition'] ] ); } } } if(!function_exists('wastia_add_hidden_device_controls_render')){ function wastia_add_hidden_device_controls_render($settings = [], $prefix = ''){ $active_devices = \Elementor\Plugin::$instance->breakpoints->get_active_devices_list( [ 'reverse' => true ] ); $active_breakpoints = \Elementor\Plugin::$instance->breakpoints->get_active_breakpoints(); $hidden = []; foreach ($active_devices as $device) { $hidden[] = ($settings[$prefix.'hide_'.$device] === 'yes') ? 'cms-hidden-'.$device : ''; } return implode(' ',array_filter($hidden)); } } // Display Alignment if(!function_exists('wastia_elementor_reponsive_flex_alignment')){ function wastia_elementor_responsive_flex_alignment($widget = [], $args = []){ $args = wp_parse_args($args, [ 'name' => 'align', 'condition' => [], 'label' => esc_html__( 'Alignment', 'wastia' ) ]); return $widget->add_responsive_control( $args['name'], [ 'label' => $args['label'], 'type' => Controls_Manager::CHOOSE, 'options' => [ 'start' => [ 'title' => esc_html__( 'Left', 'wastia' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'wastia' ), 'icon' => 'eicon-text-align-center', ], 'end' => [ 'title' => esc_html__( 'Right', 'wastia' ), 'icon' => 'eicon-text-align-right', ], 'between' => [ 'title' => esc_html__( 'Between', 'wastia' ), 'icon' => 'eicon-text-align-justify', ], ], 'condition' => $args['condition'] ] ); } } // Alignment Class if(!function_exists('wastia_elementor_get_alignment_class')){ function wastia_elementor_get_alignment_class($widget = [], $settings = [], $args = []){ $args = wp_parse_args($args, [ 'name' => '', 'default' => '', 'prefix_class' => 'text-', ]); $active_devices = \Elementor\Plugin::$instance->breakpoints->get_active_devices_list( [ 'reverse' => true ] ); $align_class = []; if(!empty($settings[$args['name']]) || !empty($args['default'])){ $align_class[] = $args['prefix_class'].$widget->get_setting($args['name'], $args['default']); } // Align Class foreach ( $active_devices as $key => $breakpoint_key ) { if($breakpoint_key !== 'desktop' && (isset($settings[$args['name'].'_' . $breakpoint_key]) && !empty($settings[$args['name'].'_' . $breakpoint_key])) ){ $align_class[] = $args['prefix_class'].str_replace('_','-',$breakpoint_key).'-'.$settings[$args['name'].'_' . $breakpoint_key]; } } // remove duplicate value $align_class = array_values(array_unique($align_class)); // return return wastia_nice_class($align_class); } } // Grid Columns if(!function_exists('wastia_elementor_grid_columns_settings')){ function wastia_elementor_grid_columns_settings($widget, $args=[]){ $args = wp_parse_args($args, [ 'name' => 'col', 'label' => esc_html__('Grid Settings', 'wastia'), 'tab' => Controls_Manager::TAB_SETTINGS, 'separator' => 'after', 'condition' => [] ]); $widget->start_controls_section( $args['name'].'_grid_section', [ 'label' => $args['label'], 'tab' => $args['tab'], 'condition' => $args['condition'] ] ); $widget->add_responsive_control( $args['name'], [ 'label' => esc_html__('Columns', 'wastia'), 'type' => Controls_Manager::SELECT, 'default' => '', 'default_args' => [ 'tablet' => '', 'mobile' => '' ], 'options' => [ '' => esc_html__('Default', 'wastia'), '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', 'auto' => esc_html__('Auto','wastia'), ], 'separator' => $args['separator'] ] ); $widget->end_controls_section(); } } if(!function_exists('wastia_elementor_get_grid_columns')){ function wastia_elementor_get_grid_columns($widget = [], $settings = [], $args = []){ $args = wp_parse_args($args, [ 'name' => 'col', 'prefix_class' => 'flex-col-', 'default' => '', 'widescreen' => '', 'desktop' => '', 'laptop' => '', 'tablet_extra' => '', 'tablet' => '', 'mobile_extra' => '', 'mobile' => '', 'smobile' => '1' ]); $active_devices = \Elementor\Plugin::$instance->breakpoints->get_active_devices_list( [ 'reverse' => true ] ); $align_class = []; if(!empty($settings[$args['name']]) || !empty($args['default']) ){ $class = (isset($settings[$args['name']]) && !empty($settings[$args['name']])) ? $settings[$args['name']] : $args['default']; $align_class[] = $args['prefix_class'].$class; } // Align Class foreach ( $active_devices as $key => $breakpoint_key ) { $breakpoint_key_class = str_replace('_','-',$breakpoint_key); $setting_breakpoint_key = (isset($settings[$args['name'].'_' . $breakpoint_key]) && !empty($settings[$args['name'].'_' . $breakpoint_key])) ? $settings[$args['name'].'_' . $breakpoint_key] : $args[$breakpoint_key]; if($breakpoint_key !== 'desktop' && !empty($setting_breakpoint_key) ){ $align_class[] = $args['prefix_class'].$breakpoint_key_class.'-'.$setting_breakpoint_key; } } $align_class[] = 'flex-col-smobile-'.$args['smobile']; $align_class[] = 'flex-col-separator-'.$widget->get_setting('col_separator', 'no'); // remove duplicate value $align_class = array_values(array_unique($align_class)); // return return wastia_nice_class($align_class); } } /** * Colors * @since 1.1.4 */ function wastia_get_color_store($custom = false, $backdrop = false) { static $color_store = null; $colors = [ 'primary' => wastia_configs('primary_color'), 'secondary' => wastia_configs('secondary_color') ]; $opts = [ 'default' => [ 'id' => '', 'label' => __( 'Default', 'wastia' ), 'group' => 'base', ] ]; foreach ($colors as $key => $value) { if(is_array($value)){ foreach ($value as $_key => $_value) { $opts[$key.'-'.$_key] = [ 'id' => $key.'-'.$_key, 'label' => ucwords($key.' '.$_key).'('.$_value.')', 'group' => 'base' ]; } } else { $opts[$key] = [ 'id' => $key, 'label' => $key.'('.$value.')', 'group' => 'base' ]; } } // $opts['body'] = [ 'id' => 'body', 'label' => esc_html__('Body','wastia'), 'group' => 'base' ]; $opts['white'] = [ 'id' => 'white', 'label' => esc_html__('White','wastia'), 'group' => 'base' ]; // Custom Color $custom_color = [ 'custom-1' => [ 'title' => esc_html__('Light Grey','wastia'), 'value' => '#f6f6f1' ], 'custom-2' => [ 'title' => esc_html__('Light Grey #2','wastia'), 'value' => '#f9f9f9' ], 'custom-3' => [ 'title' => esc_html__('Light Grey #3','wastia'), 'value' => '#ebbb40' ], 'custom-4' => [ 'title' => esc_html__('Light Grey #4','wastia'), 'value' => '#e8e8dd' ] ]; foreach ($custom_color as $c_key => $c_value) { if(is_array($c_value)){ $opts[$c_key] = [ 'id' => $c_key, 'label' => $c_value['title'], 'group' => 'base' ]; } else { $opts[$c_key] = [ 'id' => $c_key, 'label' => $c_key.' ('.$c_value['title'].')', 'group' => 'base' ]; } } // Backdrop if($backdrop){ $opts['backdrop'] = [ 'id' => 'backdrop', 'label' => esc_html__('Backdrop','wastia'), 'group' => 'base' ]; } // if($custom){ $opts['custom'] = [ 'id' => 'custom', 'label' => esc_html__('Custom','wastia'), 'group' => 'base' ]; } // Custom Color $customs = apply_filters('wastia_elementor_theme_custom_colors_store', []); if ( $color_store === null ) { $color_store = array_merge($opts, $customs); $color_store = apply_filters( 'wastia_color_store', $color_store ); } return $color_store; } function wastia_get_color_options( $custom = true, $backdrop = false, $color_ids = [], $include_all = false, $extra_colors = [] ) { if ( ! empty( $color_ids ) && is_array( $color_ids ) ) { $is_associative = array_keys( $color_ids ) !== range( 0, count( $color_ids ) - 1 ); if ( $is_associative ) { $extra_colors = $color_ids; $color_ids = []; } } $store = wastia_get_color_store($custom, $backdrop); $options = []; $add_option = static function( $id, $label ) use ( &$options ) { $label = is_string( $label ) ? $label : ''; if ( $label === '' ) { return; } $sanitized_id = ( $id === '' ) ? '' : sanitize_key( $id ); if ( $sanitized_id === '' && $id !== '' ) { return; } $options[ $sanitized_id ] = $label; }; if ( ! empty( $store ) ) { if ( empty( $color_ids ) ) { foreach ( $store as $color ) { if ( ! isset( $color['id'], $color['label'] ) ) { continue; } $is_base = isset( $color['group'] ) && $color['group'] === 'base'; if ( $include_all || $is_base ) { $add_option( $color['id'], $color['label'] ); } } } else { foreach ( $color_ids as $requested_id ) { $search_key = ( $requested_id === '' || $requested_id === 'default' ) ? 'default' : sanitize_key( $requested_id ); if ( $search_key && isset( $store[ $search_key ] ) ) { $color = $store[ $search_key ]; if ( isset( $color['id'], $color['label'] ) ) { $add_option( $color['id'], $color['label'] ); } } } } } if ( ! empty( $extra_colors ) && is_array( $extra_colors ) ) { foreach ( $extra_colors as $extra_id => $extra_label ) { $label = is_string( $extra_label ) ? wp_strip_all_tags( $extra_label ) : ''; if ( $label === '' ) { continue; } $sanitized_id = sanitize_key( $extra_id ); if ( $sanitized_id === '' && $extra_id !== '' ) { continue; } $options[ $sanitized_id ] = $label; } } if ( empty( $options ) ) { $options[''] = __( 'Default', 'wastia' ); $options['primary'] = __( 'Primary', 'wastia' ); $options['secondary'] = __( 'Secondary', 'wastia' ); } return $options; } add_filter( 'elementor/editor/localize_settings', function( $settings ) { if ( ! isset( $settings['wastiaColorStore'] ) ) { $settings['wastiaColorStore'] = wastia_get_color_store(); } if ( ! isset( $settings['wastiaColors'] ) ) { $settings['wastiaColors'] = wastia_get_color_options(); } return $settings; }, 10, 1 ); // if(!function_exists('wastia_elementor_colors_opts')){ function wastia_elementor_colors_opts($widget=[],$args = []){ $args = wp_parse_args($args, [ 'name' => '', 'selector' => [], 'label' => esc_html__('Color', 'wastia'), 'separator' => '', 'custom' => true ]); $widget->add_control( $args['name'], [ 'label' => $args['label'], 'type' => Controls_Manager::SELECT, 'options' => wastia_get_color_options(), //wastia_theme_colors(), 'default' => '', 'separator' => $args['separator'] ] ); if($args['custom']){ $widget->add_control( $args['name'].'_custom', [ 'label' => $args['label'].' '.esc_html__( 'Custom', 'wastia' ), 'type' => Controls_Manager::COLOR, 'selectors' => $args['selector'], 'condition' => [ $args['name'] => 'custom' ] ] ); } } } // Scan files to register controls for each new custom widget $files = scandir(get_template_directory() . '/elementor/core/widgets'); foreach ($files as $file) { $pos = strrpos($file, ".php"); if ($pos !== false) { require_once get_template_directory() . '/elementor/core/widgets/' . $file; } } /** * Extra Elementor Icons */ if (!function_exists('wastia_register_custom_icon_library')) { add_filter('elementor/icons_manager/native', 'wastia_register_custom_icon_library'); function wastia_register_custom_icon_library($tabs) { $custom_tabs = [ 'cmsi_icon' => [ 'name' => 'cmsi-icon', 'label' => esc_html__('CMS Icons', 'wastia'), 'url' => get_template_directory_uri() . '/assets/fonts/font-cmsi/style.css', 'enqueue' => [], 'prefix' => 'cmsi-', 'displayPrefix' => '', 'labelIcon' => 'cmsi-arrow-circle-right', 'ver' => '1.0.0', 'fetchJson' => get_template_directory_uri() . '/assets/fonts/font-cmsi.js', 'native' => true, ], 'cmsi_wastia' => [ 'name' => 'cmsi-wastia', 'label' => esc_html__('CMS Wastia', 'wastia'), 'url' => get_template_directory_uri() . '/assets/fonts/font-theme/style.css', 'enqueue' => [], 'prefix' => 'wastia-icon-', 'displayPrefix' => '', 'labelIcon' => 'wastia-icon-default', 'ver' => '1.0.0', 'fetchJson' => get_template_directory_uri() . '/assets/fonts/font-theme.js', 'native' => true, ] ]; $tabs = array_merge($custom_tabs, $tabs); return $tabs; } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
widgets
---
0755
elementor.php
45940 bytes
0644
N4ST4R_ID | Naxtarrr