public_html/wp-content/plugins/lightweight-social-icons/lightweight-social-icons.php
/**
	 * Save and sanitize values
	 * @since 0.1
	 */
Save and sanitize values
@since 0.1
Save and sanitize values @since 0 . 1
public function update( $new_instance, $old_instance ) {
		$instance = $old_instance;
		$options = lsi_icons();
		$instance['title'] = strip_tags( $new_instance['title'] );
		$instance['border_radius'] = intval( $new_instance['border_radius'] );
		$instance['font_size'] = intval( $new_instance['font_size'] );
		$instance['background'] = lsi_sanitize_hex_color( $new_instance['background'] );
		$instance['color'] = lsi_sanitize_hex_color( $new_instance['color'] );
		$instance['background_hover'] = lsi_sanitize_hex_color( $new_instance['background_hover'] );
		$instance['color_hover'] = lsi_sanitize_hex_color( $new_instance['color_hover'] );
		$instance['new_window'] = ( isset( $instance['new_window'] ) ) ? strip_tags( $new_instance['new_window'] ) : '';
		$instance['alignment'] = strip_tags( $new_instance['alignment'] );
		$instance['tooltip'] = ( isset( $new_instance['tooltip'] ) ) ? strip_tags( $new_instance['tooltip'] ) : '';
		$count = 0;
		foreach ( $options as $option ) {
			$input = 'input' . $count++;
			$select = 'select' . $count++;
			$instance[$select] = strip_tags( $new_instance[$select] );
			if ( 'skype' == $new_instance[$select] ) :
				$instance[$input] = strip_tags( $new_instance[$input] );
			elseif ( 'phone' == $new_instance[$select] ) :
				$instance[$input] = strip_tags( $new_instance[$input] );
			elseif ( 'email' == $new_instance[$select] ) :
				if ( is_email( $new_instance[$input] ) ) {
					$instance[$input] = sanitize_email( $new_instance[$input] );
				} else {
					$instance[$input] = esc_url( $new_instance[$input] );
				}
			else :
				$instance[$input] = esc_url( $new_instance[$input] );
			endif;
		}
		return $instance;
	}
public function update ( $ new_instance , $ old_instance ) { $ instance = $ old_instance ; $ options = lsi_icons ( ) ; $ instance [ 'title' ] = strip_tags ( $ new_instance [ 'title' ] ) ; $ instance [ 'border_radius' ] = intval ( $ new_instance [ 'border_radius' ] ) ; $ instance [ 'font_size' ] = intval ( $ new_instance [ 'font_size' ] ) ; $ instance [ 'background' ] = lsi_sanitize_hex_color ( $ new_instance [ 'background' ] ) ; $ instance [ 'color' ] = lsi_sanitize_hex_color ( $ new_instance [ 'color' ] ) ; $ instance [ 'background_hover' ] = lsi_sanitize_hex_color ( $ new_instance [ 'background_hover' ] ) ; $ instance [ 'color_hover' ] = lsi_sanitize_hex_color ( $ new_instance [ 'color_hover' ] ) ; $ instance [ 'new_window' ] = ( isset ( $ instance [ 'new_window' ] ) ) ? strip_tags ( $ new_instance [ 'new_window' ] ) : '' ; $ instance [ 'alignment' ] = strip_tags ( $ new_instance [ 'alignment' ] ) ; $ instance [ 'tooltip' ] = ( isset ( $ new_instance [ 'tooltip' ] ) ) ? strip_tags ( $ new_instance [ 'tooltip' ] ) : '' ; $ count = 0 ; foreach ( $ options as $ option ) { $ input = 'input' . $ count ++ ; $ select = 'select' . $ count ++ ; $ instance [ $ select ] = strip_tags ( $ new_instance [ $ select ] ) ; if ( 'skype' == $ new_instance [ $ select ] ) : $ instance [ $ input ] = strip_tags ( $ new_instance [ $ input ] ) ; elseif ( 'phone' == $ new_instance [ $ select ] ) : $ instance [ $ input ] = strip_tags ( $ new_instance [ $ input ] ) ; elseif ( 'email' == $ new_instance [ $ select ] ) : if ( is_email ( $ new_instance [ $ input ] ) ) { $ instance [ $ input ] = sanitize_email ( $ new_instance [ $ input ] ) ; } else { $ instance [ $ input ] = esc_url ( $ new_instance [ $ input ] ) ; } else : $ instance [ $ input ] = esc_url ( $ new_instance [ $ input ] ) ; endif ; } return $ instance ; }
Save and sanitize values
 @since 0.1
Save and sanitize values @since 0 . 1
// If Skype is set, strip tags // If Phone is set, strip tags // If Email is set, sanitize the address // For everything else, sanitize the URL