nombre = __('Add to Cart Button Custom Text', 'add-to-cart-custom-text'); $this->domain = 'add-to-cart-custom-text'; $this->gestor = 'options-general.php?page=add-to-cart'; $this->campos = false; $this->archivos = array('class', 'options'); $this->clases = array('EJR_Add_To_Cart', 'Opciones_EJR_Add_To_Cart'); $this->dirname = dirname (__FILE__); $this->carga_archivos($this->archivos, $this->campos); $this->carga_traducciones($this->domain); register_activation_hook (__FILE__, function () { set_transient ($this->domain . '-activado', true, 5); }, 10 ); add_action ('init', array($this, 'arranca_plugin'), 10); add_action ('admin_notices' , array( $this, 'aviso_ayuda'), 10); add_filter ('plugin_action_links', array($this, 'enlaces_accion'), 10, 2); } public function __clone () { _doing_it_wrong (__FUNCTION__, sprintf (__('You cannot clone instances of %s.', 'add-to-cart-custom-text'), get_class ($this)), '2.1.2'); } public function carga_archivos ($archivos, $campos) { foreach ($archivos as $archivo) require ($this->dirname . '/' . $archivo . '.php'); } public function arranca_plugin () { if ($this->woocommerce_activo()) foreach ($this->clases as $clase) new $clase; } private function woocommerce_activo () { if (!class_exists ('WooCommerce')) { add_action ('admin_notices', function () { ?>
' . __($this->nombre, 'add-to-cart-custom-text') . ''); ?>