/** @see WP_Widget::widget */ function widget($args, $instance) { $instance = array_merge($this->defaults, $instance); echo $args['before_widget']; if (!is_user_logged_in() && !empty($instance['title'])) { echo $args['before_title']; echo '<span class="lwa-title">'; echo apply_filters('widget_title', $instance['title'], $instance, $this->id_base); echo '</span>'; echo $args['after_title']; } elseif (is_user_logged_in() && !empty($instance['title_loggedin'])) { echo $args['before_title']; echo '<span class="lwa-title">'; echo str_replace('%username%', LoginWithAjax::$current_user->display_name, $instance['title_loggedin']); echo '</span>'; echo $args['after_title']; } LoginWithAjax::widget($instance); echo $args['after_widget']; }