/**
  *  Display the widget
  */
 public function widget($args, $instance)
 {
     //Hide the widget for logged in users?
     if (empty($instance['widget_hide_for_logged_in_users']) or !is_user_logged_in()) {
         //Before Widget
         echo $args['before_widget'];
         //Title
         if (!empty($instance['widget_title'])) {
             echo $args['before_title'] . apply_filters('widget_title', $instance['widget_title']) . $args['after_title'];
         }
         //Before Content
         if (!empty($instance['widget_content_before'])) {
             echo $instance['widget_content_before'];
         }
         //Content
         echo oa_social_login_render_login_form('widget', $instance);
         //After Content
         if (!empty($instance['widget_content_after'])) {
             echo $instance['widget_content_after'];
         }
         //After Widget
         echo $args['after_widget'];
     }
 }
示例#2
0
/**
 * Alternative for custom forms, where the output is not necessarily required at the place of calling
 * $oa_social_login_form = apply_filters('oa_social_login_custom', '');
 */
function oa_social_login_filter_login_form_custom($value = 'custom')
{
    return is_user_logged_in() ? '' : oa_social_login_render_login_form($value);
}