/
home
/
henzagold
/
blog
/
wp-content
/
themes
/
gillion
/
inc
/
plugins
/
elementor
/
File Upload :
llllll
Current File: /home/henzagold/blog/wp-content/themes/gillion/inc/plugins/elementor/elementor-elements.php
<?php namespace ElementorGillionElements; /** * Gillion Load Elements */ if( !class_exists( 'GillionElementsLoad' ) ) : class GillionElementsLoad { private static $_instance = null; private static $elements = [ // Gillion 'blog-posts' => 'Blog_Posts', 'blog-posts-basic' => 'Blog_Posts_Basic', 'blog-categories' => 'Blog_Categories', 'blog-posts-categories' => 'Blog_Posts_Categories', 'blog-slider' => 'Blog_Slider', 'blog-text-slider' => 'Blog_Text_Slider', 'author' => 'Author', 'separator-text' => 'Separator_Text', 'social-networks' => 'Social_Networks', 'image-container' => 'Image_Container', 'image-gallery' => 'Image_Gallery', 'footer-widgets' => 'Footer_Widgets', 'footer-widgets-title' => 'Footer_Widgets_Title', 'woocommerce-categories' => 'WooCommerce_Categories', 'woocommerce-products' => 'WooCommerce_Products', 'woocommerce-spotlight' => 'WooCommerce_Spotlight', ]; /** ** Register widgets */ public function __construct() { // Load WPBakery Page Builder elements (if plugin disabled) if( !defined( 'WPB_VC_VERSION' ) ) : foreach( self::$elements as $key => $element ) : if( $key == 'separator-text' ) : $key = 'seperator'; endif; require_once ( trailingslashit( get_template_directory() ) . '/inc/elements/' . esc_attr( $key ) . '.php' ); endforeach; endif; // Load Elementor elements add_action( 'elementor/widgets/widgets_registered', [ $this, 'register_widgets' ] ); } /** * Ensures only one instance of the class is loaded or can be loaded. */ public static function instance() { if ( is_null( self::$_instance ) ) { self::$_instance = new self(); } return self::$_instance; } /** ** Load widgets files */ private function include_widgets_files() { foreach( self::$elements as $key => $element ) : require_once ( trailingslashit( get_template_directory() ) . '/inc/elements-elementor/' . esc_attr( $key ) . '.php' ); endforeach; } /** * Register widgets by classes */ public function register_widgets() { $this->include_widgets_files(); foreach( self::$elements as $element ) : $class = 'ElementorGillionElements\\Widgets\\Gillion_'.$element; \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new $class() ); endforeach; } } GillionElementsLoad::instance(); endif;
Copyright ©2k19 -
Hexid
|
Tex7ure