public function register_plugin_shortcodes($attrs) { $default_options = ESSBSocialFollowersCounterHelper::default_instance_settings(); $attrs = shortcode_atts($default_options, $attrs); //print_r($attrs); ob_start(); ESSBSocialFollowersCounterDraw::draw_followers($attrs, true); $html = ob_get_contents(); ob_end_clean(); return $html; }
public function widget($args, $instance) { $before_widget = $args['before_widget']; $before_title = $args['before_title']; $after_title = $args['after_title']; $after_widget = $args['after_widget']; $title = isset($instance['title']) ? $instance['title'] : ''; $hide_title = isset($instance['hide_title']) ? $instance['hide_title'] : 0; if (intval($hide_title) == 1) { $title = ""; } if (!empty($title)) { echo $before_widget . $before_title . $title . $after_title; } // draw follower buttons with title set to off - this will be handle by the widget setup ESSBSocialFollowersCounterDraw::draw_followers($instance, false); if (!empty($title)) { echo $after_widget; } }