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); add_action ('init', array($this, 'arranca_plugin'), 10); add_filter ('plugin_action_links', array($this, 'enlaces_accion'), 10, 2); } function carga_archivos ($archivos, $campos) { foreach ($archivos as $archivo) require ($this->dirname . '/' . $archivo . '.php'); } 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') . ''); ?>