HEX
Server: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips
System: Linux WORDPRESS 3.10.0-1160.118.1.el7.x86_64 #1 SMP Thu Apr 4 03:33:23 EDT 2024 x86_64
User: digital (1020)
PHP: 7.2.24
Disabled: NONE
Upload Files
File: /datos/www/expodubai.colombia.co/wp-content/plugins/modern-events-calendar-lite/app/addons/divi.php
<?php
/** no direct access **/
defined('MECEXEC') or die();

/**
 * Webnus MEC Divi addon class
 * @author Webnus <[email protected]>
 */
class MEC_addon_divi extends MEC_base
{
    /**
     * @var MEC_factory
     */
    public $factory;

    /**
     * @var MEC_main
     */
    public $main;

    /**
     * Constructor method
     * @author Webnus <[email protected]>
     */
    public function __construct()
    {
        // MEC Factory class
        $this->factory = $this->getFactory();
        
        // MEC Main class
        $this->main = $this->getMain();
    }
    
    /**
     * Initialize the Elementor addon
     * @author Webnus <[email protected]>
     */
    public function init()
    {
        // Divi is not installed
        $theme = wp_get_theme(); // gets the current theme

        if('Divi' != $theme->get_template()) return false;

        add_action('divi_extensions_init', array($this, 'mecdivi_initialize_extension'));
        add_filter('et_builder_load_actions', array($this, 'add_ajax_actions'));

        return true;
    }

	/**
	 * Creates the extension's main class instance.
	 *
	 * @since 1.0.0
	 */
	public function mecdivi_initialize_extension()
    {
		require_once plugin_dir_path( __FILE__ ) . 'divi/includes/Divi.php';
		require_once plugin_dir_path( __FILE__ ) . 'divi/includes/MECShortcodesForDivi.php';
	}

    public function add_ajax_actions($actions)
    {
        $actions[] = 'mec_load_single_page';
        return $actions;
    }
}