Sid Gifari File Manager
🏠 Root
/
home
/
ailwtbdh
/
lynchestinegroup.com
/
wp-content
/
plugins
/
koncrete-core_2
/
elementor
/
Editing: base.php
<?php /** * @author RadiusTheme * @since 1.0 * @version 1.0 */ namespace radiustheme\Koncrete_Core; use \ReflectionClass; use Elementor\Widget_Base; if ( ! defined( 'ABSPATH' ) ) exit; abstract class Custom_Widget_Base extends Widget_Base { public $rt_name; public $rt_base; public $rt_category; public $rt_icon; public $rt_translate; public $rt_dir; public function __construct( $data = array(), $args = null ) { $this->rt_category = Constants::$theme_prefix . '-widgets'; $this->rt_icon = 'fa fa-registered'; $this->rt_dir = dirname( ( new ReflectionClass( $this ) )->getFileName() ); parent::__construct( $data, $args ); } abstract public function rt_fields(); public function get_name() { return $this->rt_base; } public function get_title() { return $this->rt_name; } public function get_icon() { return $this->rt_icon; } public function get_categories() { return array( $this->rt_category ); } protected function _register_controls() { $fields = $this->rt_fields(); foreach ( $fields as $field ) { if ( isset( $field['mode'] ) && $field['mode'] == 'section_start' ) { $id = $field['id']; unset( $field['id'] ); unset( $field['mode'] ); $this->start_controls_section( $id, $field ); } elseif ( isset( $field['mode'] ) && $field['mode'] == 'section_end' ) { $this->end_controls_section(); } elseif ( isset( $field['mode'] ) && $field['mode'] == 'group' ) { $type = $field['type']; unset( $field['mode'] ); unset( $field['type'] ); $this->add_group_control( $type, $field ); } elseif ( isset( $field['mode'] ) && $field['mode'] == 'responsive' ) { $id = $field['id']; unset( $field['id'] ); unset( $field['mode'] ); $this->add_responsive_control( $id, $field ); } else { $id = $field['id']; unset( $field['id'] ); $this->add_control( $id, $field ); } } } public function rt_template( $template, $data ) { $template_name = DIRECTORY_SEPARATOR . 'elementor-custom' . DIRECTORY_SEPARATOR . basename( $this->rt_dir ) . DIRECTORY_SEPARATOR . $template . '.php'; if ( file_exists( STYLESHEETPATH . $template_name ) ) { $file = STYLESHEETPATH . $template_name; } elseif ( file_exists( TEMPLATEPATH . $template_name ) ) { $file = TEMPLATEPATH . $template_name; } else { $file = $this->rt_dir . DIRECTORY_SEPARATOR . $template . '.php'; } ob_start(); include $file; echo ob_get_clean(); } }
Save
Cancel