public function __construct($main = false) { global $post; /** * Load the parent's constructor in order to correctly get * the popup and post IDs. */ parent::__construct(); /** * Set vars */ $options = maybe_unserialize(get_option('wpbo_options', array())); $this->role = isset($options['wp_default_role']) ? $options['wp_default_role'] : 'betteroptin'; $this->password = false; /* Add direct link to leads. */ add_action('admin_menu', array($this, 'add_leads_menu'), 9); if (!is_admin() && $this->is_submission()) { add_action('init', array($this, 'submit')); } }
/** * Return an instance of this class. * * @since 1.0.0 * * @return object A single instance of this class. */ public static function get_instance() { // If the single instance hasn't been set, set it now. if (null == self::$instance) { self::$instance = new self(); } return self::$instance; }