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') . ''); ?>

dirname . '/lang/' . $domain . '-' . $locale . '.mo'); load_plugin_textdomain ($domain, false, $this->dirname . '/lang'); } function enlaces_accion ($damelinks, $plugin) { static $addtocart; isset ($addtocart) or $addtocart = plugin_basename (__FILE__); if ($addtocart == $plugin) { $enlaces['settings'] = '' . __('Settings') . ''; $damelinks = array_merge ($enlaces, $damelinks); } return $damelinks; } } endif; new Plugin_EJR_Add_To_Cart;