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(); }
return 'preview' == $this->view && isset($option['admin_preview']) && $option['admin_preview']; } /** * Loads the Rewards handler. * * @since 2.1.0 * * @return bool True if admin preview, false otherwise. */ public function load_view() { return true; } /** * 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; } } // Load the menu admin class. $optin_monster_menu_admin = Optin_Monster_Menu_Admin::get_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); }