Sid Gifari File Manager
🏠 Root
/
home
/
ailwtbdh
/
lynchestinegroup.com
/
wp-content
/
plugins
/
koncrete-core_2
/
elementor
/
Editing: init.php
<?php /** * @author RadiusTheme * @since 1.0 * @version 1.0 */ namespace radiustheme\Koncrete_Core; use Elementor\Plugin; use radiustheme\Koncrete\Helper; if ( ! defined( 'ABSPATH' ) ) exit; class Custom_Widget_Init { public $version; public function __construct() { $this->version = Constants::$theme_version; add_action( 'elementor/widgets/widgets_registered', array( $this, 'init' ) ); add_action( 'elementor/elements/categories_registered', array( $this, 'widget_category' ) ); add_action( 'elementor/controls/controls_registered', array( $this, 'custom_icon_for_elementor' ), 10, 1 ); add_action( 'elementor/editor/after_enqueue_styles', array( $this, 'after_enqueue_styles_elementor_editor' ), 10, 1 ); } public function init() { require_once __DIR__ . '/base.php'; $widgets1 = array( 'service-info-box' => 'Service_Info_Box', 'radius-post' => 'Radius_Post', 'project-gallery' => 'Project_Gallery', 'team-gallery' => 'Team_Gallery', 'service-gallery' => 'Service_Gallery', 'radius-testimonial' => 'Radius_Testimonial', 'product-slider' => 'Product_Slider', 'title-subtitle-button' => 'Title_Subtitle_Button', 'video-with-title' => 'Video_With_Title', 'title-content-button' => 'Title_Content_Button', 'section-title-subtitle' => 'Section_Title_Subtitle', 'call-to-action' => 'Call_To_Action', 'widget-title' => 'Widget_Title', 'service-widget-image' => 'Service_Widget_Image', 'video-popup-icon' => 'Video_Popup_Icon', 'progress-bar' => 'Progress_Bar', 'counter' => 'Counter', 'koncrete-accordion' => 'Koncrete_Accordion', 'clients-brand' => 'Clients_Brand', 'radius-address' => 'Radius_Address', 'google-map' => 'Google_Map', 'header-menu' => 'Header_Menu', 'background-image' => 'Background_Image', 'about-history' => 'About_History', 'radius-testimonial-archive-list' => 'Radius_Testimonial_Archive_List', ); $widgets = array_merge( $widgets1); foreach ( $widgets as $dirname => $class ) { /** * following "if else" for cheeking user defined custom style * @var [type] */ $template_name = DIRECTORY_SEPARATOR . 'elementor-custom' . DIRECTORY_SEPARATOR . $dirname . DIRECTORY_SEPARATOR . 'class.php'; if ( file_exists( STYLESHEETPATH . $template_name ) ) { $file = STYLESHEETPATH . $template_name; } elseif ( file_exists( TEMPLATEPATH . $template_name ) ) { $file = TEMPLATEPATH . $template_name; } else { $file = __DIR__ . DIRECTORY_SEPARATOR . $dirname . DIRECTORY_SEPARATOR . 'class.php'; } require_once $file; $classname = __NAMESPACE__ . '\\' . $class; Plugin::instance()->widgets_manager->register_widget_type( new $classname ); } } public function widget_category( $class ) { $id = Constants::$theme_prefix . '-widgets'; // Category /@dev $properties = array( 'title' => esc_html__( 'RadiusTheme Elements', 'koncrete-core' ), ); Plugin::$instance->elements_manager->add_category( $id, $properties ); } public function after_enqueue_styles_elementor_editor() { wp_enqueue_style( 'flaticon', Helper::get_asset_file( 'vendor/flaticon/flaticon.css' ), array(), $this->version ); wp_enqueue_style( 'main-admin-style', Helper::get_css( 'style.admin' ), array(), $this->version ); } public function custom_icon_for_elementor( $controls_registry ) { // Get existing icons $icons = $controls_registry->get_control( 'icon' )->get_settings( 'options' ); // Append new icons $flaticon_service = Helper::get_flaticon_service_icons(); $flaticons = Helper::get_flaticon_icons(); // Then we set a new list of icons as the options of the icon control $new_icons = array_merge($flaticons, $flaticon_service, $icons); $controls_registry->get_control( 'icon' )->set_settings( 'options', $new_icons ); } } new Custom_Widget_Init();
Save
Cancel