public function __construct() { // Get some useful class instances. $this->base = Optin_Monster::get_instance(); $this->common = Optin_Monster_Common::get_instance(); $this->admin = Optin_Monster_Menu_Admin::get_instance(); // Make sure get_plugins() is available. if (!function_exists('get_plugins')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } // See if we've done this before and save the auth info. $this->auth = get_option('awesomemotive_auth'); // Find out what kind of request we'll be making. $this->request_type = $this->get_request_type(); // Gather the required data. $this->data = $this->gather_data(); }
/** * Returns the singleton instance of the class. * * @since 2.0.0 * * @return object The Optin_Monster_Menu_Admin object. */ public static function get_instance() { if (!isset(self::$instance) && !self::$instance instanceof Optin_Monster_Menu_Admin) { self::$instance = new Optin_Monster_Menu_Admin(); } return self::$instance; }
/** * Retrieve the plugin basename from the plugin slug. * * @since 2.0.0 * * @param string $slug The plugin slug. * @return string The plugin basename if found, else the plugin slug. */ public function get_plugin_basename_from_slug($slug) { return Optin_Monster_Menu_Admin::get_instance()->get_plugin_basename_from_slug($slug); }