D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
etb1lp46s9ed
/
public_html
/
a3legalservices.site
/
wp-content
/
plugins
/
aeen-core
/
elementor
/
Filename :
init.php
back
Copy
<?php /** * @author RadiusTheme * @since 1.0 * @version 1.0 */ namespace radiustheme\Aeen_Core; use radiustheme\aeen\inc\Helper; use Elementor\Plugin; if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly require_once AEEN_CORE_BASE_DIR. '/elementor/controls/traits-icons.php'; class Custom_Widget_Init { public function __construct() { add_action( 'elementor/widgets/widgets_registered', array( $this, 'init' ) ); add_action( 'elementor/elements/categories_registered', array( $this, 'widget_categoty' ) ); add_action( 'elementor/editor/after_enqueue_styles', array( $this, 'editor_style' ) ); add_action( 'elementor/icons_manager/additional_tabs', array( $this, 'aeen_flaticon_tab' ) ); } /** * Adding custom icon to icon control in Elementor */ public function aeen_flaticon_tab( $tabs = array() ) { // Append new icons $flat_icons = ElementorIconTrait::flaticon_icons(); $tabs['aeen-flaticon-icons'] = array( 'name' => 'aeen-flaticon-icons', 'label' => esc_html__( 'Flat Icons', 'aeen-core' ), 'labelIcon' => 'flaticon-search', 'prefix' => '', 'displayPrefix' => '', 'url' => Helper::get_css( 'flaticon' ), 'icons' => $flat_icons, 'ver' => '1.0', ); return $tabs; } public function editor_style() { $img = plugins_url( 'icon.png', __FILE__ ); wp_add_inline_style( 'elementor-editor', '.elementor-element .icon .rdtheme-el-custom{content: url( '.$img.');width: 28px;}' ); wp_add_inline_style( 'elementor-editor', '.select2-container--default .select2-selection--single {min-width: 126px !important; min-height: 30px !important;}' ); } public function set_elementor_default_options() { $data = array( 'elementor_disable_typography_schemes' => 'yes', 'elementor_disable_color_schemes' => 'yes', 'elementor_css_print_method' => 'internal', 'elementor_cpt_support' => array( "page" ), 'elementor_container_width' => '1200', 'elementor_viewport_lg' => '992', '_elementor_general_settings' => array( 'default_generic_fonts' => 'Sans-serif', 'global_image_lightbox' => 'yes', 'container_width' => '1200', ), '_elementor_global_css' => array( 'time' => '1534145031', 'fonts' => array(), 'status' => 'inline', '0' => false, 'css' => '.elementor-section.elementor-section-boxed > .elementor-container { max-width:1200px; }', ), ); foreach ( $data as $key => $value ) { update_option( $key, $value ); } } public function init() { require_once __DIR__ . '/base.php'; $widgets = array( 'title' => 'Title', 'image-box' => 'Image_Box', 'about-box' => 'About_Box', 'progress-box' => 'Progress_Box', 'team' => 'Rt_Team', 'services' => 'Services', 'price' => 'Rt_Price', 'history' => 'Rt_History', 'testimonial' => 'Rt_Testimonial', 'brand-logos' => 'Rt_Brand_Logos', 'banner' => 'Banner', // New Added 'service-box' => 'Service_Box', 'section-heading' => 'Section_Heading', 'signature' => 'Signature', 'video' => 'Video_Button', 'cta' => 'Rt_Cta', 'case-studies' => 'Case_Studies', 'case-studies-isotope' => 'Case_Studies_Isotope', 'contact-box' => 'Contact_Box', 'post' => 'Rt_Post', 'practice' => 'Rt_Practice', 'button' => 'Button', 'gallery' => 'RT_Gallery', 'social' => 'RT_Social', 'career-info' => 'Career_Info', 'icon-list' => 'Icon_List', 'experience-box' => 'Experience_Box', 'skills' => 'Skills', ); foreach ( $widgets as $dirname => $class ) { $template_name = '/elementor-custom/' . $dirname . '/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__ . '/' . $dirname . '/class.php'; } require_once $file; $classname = __NAMESPACE__ . '\\' . $class; Plugin::instance()->widgets_manager->register_widget_type( new $classname ); } } public function widget_categoty( $class ) { $id = AEEN_CORE_THEME_PREFIX . '-widgets'; $properties = array( 'title' => __( 'RadiusTheme Elements', 'aeen-core' ), ); Plugin::$instance->elements_manager->add_category( $id, $properties ); } } new Custom_Widget_Init();