Exemplo n.º 1
0
 /**
  * Main Followers_Admin Instance
  *
  * Ensures only one instance of Followers_Admin is loaded or can be loaded.
  *
  * @since 1.0.0
  * @static
  * @return Main Followers_Admin instance
  */
 public static function instance()
 {
     if (is_null(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Exemplo n.º 2
0
 /**
  * Constructor function.
  * @access  public
  * @since   1.0.0
  * @return  void
  */
 public function __construct()
 {
     $this->token = 'followers';
     $this->plugin_url = plugin_dir_url(__FILE__);
     $this->plugin_path = plugin_dir_path(__FILE__);
     $this->version = '1.0.0';
     $this->services = array('facebook' => array('fans' => 'Fans', 'like' => 'Like'), 'twitter' => array('fans' => 'Followers', 'like' => 'Follow'), 'google-plus' => array('fans' => 'Fans', 'like' => '+1'), 'behance' => array('fans' => 'Followers', 'like' => 'Follow'), 'instagram' => array('fans' => 'Followers', 'like' => 'Follow'), 'dribbble' => array('fans' => 'Fans', 'like' => 'Like'), 'linkedin' => array('fans' => 'Shares', 'like' => 'Like'), 'github' => array('fans' => 'Followers', 'like' => 'Follow'), 'youtube' => array('fans' => 'Fans', 'like' => 'Like'), 'pinterest' => array('fans' => 'Fans', 'like' => 'Like'));
     // Admin - Start
     require_once 'classes/class-followers-settings.php';
     $this->settings = Followers_Settings::instance();
     if (is_admin()) {
         require_once 'classes/class-followers-admin.php';
         $this->admin = Followers_Admin::instance();
     }
     // Admin - End
     // Widget
     require_once 'classes/class-followers-widget.php';
     // Counters
     require_once 'classes/class-followers-counters.php';
     register_activation_hook(__FILE__, array($this, 'install'));
     add_action('init', array($this, 'load_plugin_textdomain'));
     add_action('admin_init', array($this, 'admin_init'));
     add_action('widgets_init', array($this, 'register_widget'));
     add_action('wp_enqueue_scripts', array($this, 'enqueue_styles'));
 }