/** * Constructor */ public function __construct() { // Define the constants self::$plugin_prefix = 'wcdn_'; self::$plugin_basefile_path = __FILE__; self::$plugin_basefile = plugin_basename(self::$plugin_basefile_path); self::$plugin_url = plugin_dir_url(self::$plugin_basefile); self::$plugin_path = trailingslashit(dirname(self::$plugin_basefile_path)); // Set hooks and wait for WooCommerce to load register_activation_hook(self::$plugin_basefile_path, array($this, 'install')); add_action('plugins_loaded', array($this, 'localise')); add_action('woocommerce_init', array($this, 'load')); }
/** * Define WC Constants */ private function define_constants() { self::$plugin_version = '4.1.5'; self::$plugin_prefix = 'wcdn_'; self::$plugin_basefile_path = __FILE__; self::$plugin_basefile = plugin_basename(self::$plugin_basefile_path); self::$plugin_url = plugin_dir_url(self::$plugin_basefile); self::$plugin_path = trailingslashit(dirname(self::$plugin_basefile_path)); self::$plugin_text_domain = trim(dirname(self::$plugin_basefile)); }