Esempio n. 1
0
function xing_get_follow_button($options = array())
{
    if (!class_exists('XING_Follow_Button')) {
        require_once dirname(__FILE__) . '/xing-follow-button.php';
    }
    $follow_button = new XING_Follow_Button($options);
    if (!$follow_button) {
        return null;
    }
    $html = $follow_button->asHTML();
    if ($html) {
        return "\n" . $html . "\n";
    }
    return '';
}
 /**
  * Outputs the content of the widget
  *
  * @param array $args
  * @param array $instance
  */
 public function widget($args, $instance)
 {
     extract($args);
     if (!class_exists('XING_Follow_Button')) {
         require_once $this->plugin_directory . 'xing_follow_button.php';
     }
     $follow_button = new XING_Follow_Button($instance);
     $follow_button_html = $follow_button->asHTML();
     if (!(is_string($follow_button_html) && $follow_button_html)) {
         return;
     }
     echo $before_widget;
     $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     echo $follow_button_html;
     echo $after_widget;
 }