'; echo __( 'WP Event Manager is require to use WP Event Manager - Divi Elements' , 'wpem-divi-elements'); echo '

'; } //return true; } } add_action( 'admin_notices', 'pre_check_before_installing_divi_elements' ); /** * WP_Event_Manager_Divi_Elements class. */ class WPEM_Divi_Elements { /** * The single instance of the class. * * @var self * @since 1.0.0 */ private static $_instance = null; /** * Main WP Event Manager Instance. * * Ensures only one instance of WP Event Manager is loaded or can be loaded. * * @since 1.0.0 * @static * @see WP_Event_Manager() * @return self Main instance. */ public static function instance() { if ( is_null( self::$_instance ) ) { self::$_instance = new self(); } return self::$_instance; } /** * Constructor */ public function __construct() { // Define constants define( 'WPEM_DIVI_ELEMENTS_VERSION', '1.0.1' ); define( 'WPEM_DIVI_ELEMENTS_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) ); define( 'WPEM_DIVI_ELEMENTS_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) ); add_action( 'divi_extensions_init', array($this,'wpem_initialize_extension') ); } /** * Creates the extension's main class instance. * * @since 1.0.0 */ public function wpem_initialize_extension() { require_once plugin_dir_path( __FILE__ ) . 'includes/WpEventManagerDiviElements.php'; } /** * Localisation */ public function load_plugin_textdomain() { $domain = 'wpem-divi-elements'; $locale = apply_filters('plugin_locale', get_locale(), $domain); load_textdomain( $domain, WP_LANG_DIR . "/wpem-divi-elements/".$domain."-" .$locale. ".mo" ); load_plugin_textdomain($domain, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); } } /** * Main instance of WP Event Manager Speaker & Schedule. * * Returns the main instance of WP Event Manager to prevent the need to use globals. * * @since 1.0.0 * @return WPEM_Divi_Elements */ function wpem_divi_elements() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName return WPEM_Divi_Elements::instance(); } $GLOBALS['wpem_divi_elements'] = wpem_divi_elements();