public static function &get_instance() { if (self::$instance === null) { self::$instance = new self(); } return self::$instance; }
public function __construct() { $this->p =& Ngfb::get_instance(); if (!is_object($this->p)) { return; } $lca = $this->p->cf['lca']; $short = $this->p->cf['plugin'][$lca]['short']; $widget_name = 'Sharing Buttons'; $widget_class = $this->p->cf['lca'] . '-widget-buttons'; $widget_ops = array('classname' => $widget_class, 'description' => 'The ' . $short . ' social sharing buttons widget.'); $this->WP_Widget($widget_class, $widget_name, $widget_ops); }
public function __construct() { $this->p =& Ngfb::get_instance(); if (!is_object($this->p)) { return; } $lca = $this->p->cf['lca']; $short = $this->p->cf['plugin'][$lca]['short']; $name = $this->p->cf['plugin'][$lca]['name']; $widget_name = $short . ' Sharing Buttons'; $widget_class = $lca . '-widget-buttons'; $widget_ops = array('classname' => $widget_class, 'description' => sprintf(__('The %s social sharing buttons widget.', 'nextgen-facebook'), $short)); parent::__construct($widget_class, $widget_name, $widget_ops); }
public static function get_pref($idx = false, $user_id = false) { $user_id = $user_id === false ? get_current_user_id() : $user_id; if (!isset(self::$pref[$user_id]['options_filtered']) || self::$pref[$user_id]['options_filtered'] !== true) { self::$pref[$user_id] = get_user_meta($user_id, NGFB_PREF_NAME, true); if (!is_array(self::$pref[$user_id])) { self::$pref[$user_id] = array(); } $ngfb = Ngfb::get_instance(); if (!isset(self::$pref[$user_id]['show_opts'])) { self::$pref[$user_id]['show_opts'] = $ngfb->options['plugin_show_opts']; } self::$pref[$user_id]['options_filtered'] = true; } if ($idx !== false) { if (isset(self::$pref[$user_id][$idx])) { return self::$pref[$user_id][$idx]; } else { return false; } } else { return self::$pref[$user_id]; } }
function ngfb_schema_attributes($attr = '') { $ngfb =& Ngfb::get_instance(); echo $ngfb->schema->add_head_attributes($attr); }
function ngfb_get_short_url($use_post = false, $add_page = true, $source_id = false) { $ngfb =& Ngfb::get_instance(); return apply_filters('ngfb_shorten_url', $ngfb->util->get_sharing_url($post_id, $add_page, $source_id), $ngfb->options['plugin_shortener']); }