File: /home/niched/writesideup.net/wp-content/plugins/codevz-plus/elementor/elementor.php
<?php if ( ! defined( 'ABSPATH' ) ) {exit;}
/**
*
* Codevz elementor add-on
*
* @author Codevz
* @link http://codevz.com/
*
*/
class Codevz_Elementor {
private static $instance = null;
public function __construct() {
add_action( 'elementor/controls/controls_registered', array( __CLASS__, 'controls' ) );
add_action( 'elementor/widgets/widgets_registered', array( __CLASS__, 'widgets' ) );
}
/**
*
* Instance
*
* @return class|null
*
*/
public static function instance() {
if ( self::$instance === null ) {
self::$instance = new self();
}
return self::$instance;
}
/**
*
* Enqueue assets
*
* @return string
*
*/
public static function enqueue() {
wp_enqueue_script( 'codevz-elementor', CDVZ_PLUGIN_URI . 'elementor/elementor.js', array( 'jquery' ), '', false );
wp_enqueue_style( 'codevz-elementor', CDVZ_PLUGIN_URI . 'elementor/elementor.css' );
}
/**
*
* Custom controls
*
* @return object
*
*/
public static function controls() {
foreach ( glob( CDVZ_PLUGIN_DIR . 'elementor/controls/*.php' ) as $i ) {
require_once( $i );
$name = str_replace( '.php', '', basename( $i ) );
$class = 'Codevz_Elementor_' . $name;
$class = new $class();
\Elementor\Plugin::$instance->controls_manager->register_control( $class->get_type(), $class );
}
}
/**
*
* Custom widgets
*
* @return object
*
*/
public static function widgets() {
foreach ( glob( CDVZ_PLUGIN_DIR . 'elementor/widgets/*.php' ) as $i ) {
require_once( $i );
$name = str_replace( '.php', '', basename( $i ) );
$class = 'Codevz_Elementor_' . $name;
\Elementor\Plugin::instance()->widgets_manager->register_widget_type( new $class() );
}
}
}
// Run
Codevz_Elementor::instance();