/** * Initialize the plugin by setting localization, filters, and administration functions. * * @since 1.0 */ private function __construct() { // retrieve custom plugin settings $this->options = get_option('aiwp_settings', array()); // get user device info $this->detect = new Mobile_Detect(); // if admin area, get instance of admin class if (is_admin()) { Appear_In_WP_Admin::get_instance(); } else { add_action('template_redirect', array($this, 'respond_to_shortcode')); } // add the shortcode add_shortcode('appear_in', array($this, 'display_shortcode')); }
/** * Return an instance of this class. * * @since 1.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(); } // end if return self::$instance; }