Add plugin name as environment variable.
This commit is contained in:
@ -4,6 +4,7 @@ namespace MailPoet\Config;
|
|||||||
if(!defined('ABSPATH')) exit;
|
if(!defined('ABSPATH')) exit;
|
||||||
|
|
||||||
class Env {
|
class Env {
|
||||||
|
public static $plugin_name;
|
||||||
public static $plugin_prefix;
|
public static $plugin_prefix;
|
||||||
public static $db_prefix;
|
public static $db_prefix;
|
||||||
public static $db_source_name;
|
public static $db_source_name;
|
||||||
@ -15,6 +16,7 @@ class Env {
|
|||||||
|
|
||||||
public static function init() {
|
public static function init() {
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
self::$plugin_name = 'mailpoet';
|
||||||
self::$plugin_prefix = 'mailpoet_';
|
self::$plugin_prefix = 'mailpoet_';
|
||||||
self::$db_prefix = $wpdb->prefix . self::$plugin_prefix;
|
self::$db_prefix = $wpdb->prefix . self::$plugin_prefix;
|
||||||
self::$db_source_name = self::dbSourceName();
|
self::$db_source_name = self::dbSourceName();
|
||||||
|
@ -23,7 +23,7 @@ class Initializer {
|
|||||||
|
|
||||||
$this->data = array();
|
$this->data = array();
|
||||||
$this->version = $params['version'];
|
$this->version = $params['version'];
|
||||||
$this->shortname = 'wysija-newsletters';
|
$this->shortname = Env::$plugin_name;
|
||||||
$this->file = $params['file'];
|
$this->file = $params['file'];
|
||||||
$this->path =(dirname($this->file));
|
$this->path =(dirname($this->file));
|
||||||
$this->views_path = $this->path . '/views';
|
$this->views_path = $this->path . '/views';
|
||||||
|
Reference in New Issue
Block a user