esc_html__( 'The Blog author Socials', 'adena'), ) ); } // Creating widget front-end public function widget( $args, $instance ) { // Get Data $title = apply_filters( 'widget_title', $instance['title'] ); $tw = $instance[ 'tw' ]; $fb = $instance[ 'fb' ]; $gp = $instance[ 'gp' ]; $in = $instance[ 'in' ]; $yt = $instance[ 'yt' ]; $html = ''; $html .= '
  • '.$title.'
  • '; un_echo( $html, 'html'); } // Widget Backend public function form( $instance ) { $html = ''; // Set Title if ( isset( $instance[ 'title' ] ) ) { $title = $instance[ 'title' ]; }else { $title = 'follow this blog'; } // Set Twitter if ( isset( $instance[ 'tw' ] ) ) { $tw = $instance[ 'tw' ]; }else { $tw = ''; } // Set Facebook if ( isset( $instance[ 'fb' ] ) ) { $fb = $instance[ 'fb' ]; }else { $fb = ''; } // Set Google+ if ( isset( $instance[ 'gp' ] ) ) { $gp = $instance[ 'gp' ]; }else { $gp = ''; } // Set Instagram if ( isset( $instance[ 'in' ] ) ) { $in = $instance[ 'in' ]; }else { $in = ''; } // Set YouTube if ( isset( $instance[ 'yt' ] ) ) { $yt = $instance[ 'yt' ]; }else { $yt = ''; } // Widget admin form $html .= '

    '.esc_html__('Leave blank to disable it', 'adena').'

    '.esc_html__('Leave blank to disable it', 'adena').'

    '.esc_html__('Leave blank to disable it', 'adena').'

    '.esc_html__('Leave blank to disable it', 'adena').'

    '.esc_html__('Leave blank to disable it', 'adena').'

    '; un_echo( $html, 'html' ); } // Updating widget replacing old instances with new public function update( $new_instance, $old_instance ) { $instance = array(); $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : ''; $instance['tw'] = ( ! empty( $new_instance['tw'] ) ) ? strip_tags( $new_instance['tw'] ) : ''; $instance['fb'] = ( ! empty( $new_instance['fb'] ) ) ? strip_tags( $new_instance['fb'] ) : ''; $instance['gp'] = ( ! empty( $new_instance['gp'] ) ) ? strip_tags( $new_instance['gp'] ) : ''; $instance['in'] = ( ! empty( $new_instance['in'] ) ) ? strip_tags( $new_instance['in'] ) : ''; $instance['yt'] = ( ! empty( $new_instance['yt'] ) ) ? strip_tags( $new_instance['yt'] ) : ''; return $instance; } } // Class wpb_widget ends here // Register and load the widget function un_follow_me_load() { register_widget( 'un_follow_me' ); } add_action( 'widgets_init', 'un_follow_me_load' );