'widget-biancaa-about', 'description' => __( 'Display your profile info.', 'biancaa' ) ); // Create the widget. $this->WP_Widget( 'biancaa-about', // $this->id_base __( 'Biancaa - About', 'biancaa' ), // $this->name $widget_options // $this->widget_options ); } /** * Outputs the widget based on the arguments input through the widget controls. * * @since 1.0.0 */ function widget( $args, $instance ) { extract( $args ); // Output the theme's $before_widget wrapper. echo $before_widget; // If the title not empty, display it. if ( $instance['title'] ) { echo $before_title . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $after_title; } echo '
'; if ( $instance['gravatar'] ) { echo get_avatar( is_email( $instance['gravatar'] ), 70 ); } if ( $instance['bio'] ) { echo '

' . stripslashes( $instance['bio'] ) . '

'; } echo ''; echo '
'; // Close the theme's widget wrapper. echo $after_widget; } /** * Updates the widget control options for the particular instance of the widget. * * @since 1.0.0 */ function update( $new_instance, $old_instance ) { $instance = $new_instance; $instance['title'] = strip_tags( $new_instance['title'] ); $instance['gravatar'] = is_email( $new_instance['gravatar'] ); $instance['bio'] = wp_filter_post_kses( $new_instance['bio'] ); $instance['twitter'] = esc_url_raw( $new_instance['twitter'] ); $instance['facebook'] = esc_url_raw( $new_instance['facebook'] ); $instance['gplus'] = esc_url_raw( $new_instance['gplus'] ); $instance['linkedin'] = esc_url_raw( $new_instance['linkedin'] ); return $instance; } /** * Displays the widget control options in the Widgets admin screen. * * @since 1.0.0 */ function form( $instance ) { // Default value. $defaults = array( 'title' => '', 'gravatar' => get_option( 'admin_email' ), 'bio' => '', 'twitter' => '', 'facebook' => '', 'gplus' => '', 'linkedin' => '', ); $instance = wp_parse_args( (array) $instance, $defaults ); ?>