public_html/wp-content/plugins/lightweight-social-icons/lightweight-social-icons.php
/**
	 * Front-end display of widget.
	 * @since 0.1
	 */
Front-end display of widget.
Front - end display of widget .
public function widget( $args, $instance ) {
		$this->scripts['lsi_scripts'] = true;
		$title = apply_filters( 'widget_title', $instance['title'] );
		$options = lsi_icons();
		$defaults = lsi_option_defaults();
		$unique_id = $args['widget_id'];
		$output = '';
		echo $args['before_widget'];
		echo ( ! empty( $title ) ) ? $args['before_title'] . $title . $args['after_title'] : '';
		$new_window = ( isset( $instance['new_window'] ) && '' !== $instance['new_window'] ) ? 'target="_blank"' : $defaults['new_window'];
		$font_size = ( isset( $instance['font_size'] ) && '' !== $instance['font_size'] ) ? $instance['font_size'] : $defaults['font_size'];
		$border_radius = ( isset( $instance['border_radius'] ) && '' !== $instance['border_radius'] ) ? $instance['border_radius'] : $defaults['border_radius'];
		$background = ( isset( $instance['background'] ) && '' !== $instance['background'] ) ? $instance['background'] : $defaults['background'];
		$color = ( isset( $instance['color'] ) && '' !== $instance['color'] ) ? $instance['color'] : $defaults['color'];
		$background_hover = ( isset( $instance['background_hover'] ) && '' !== $instance['background_hover'] ) ? $instance['background_hover'] : $defaults['background_hover'];
		$color_hover = ( isset( $instance['color_hover'] ) && '' !== $instance['color_hover'] ) ? $instance['color_hover'] : $defaults['color_hover'];
		$alignment = ( isset( $instance['alignment'] ) && '' !== $instance['alignment'] ) ? $instance['alignment'] : $defaults['alignment'];
		$tooltip = ( isset( $instance['tooltip'] ) && '' !== $instance['tooltip'] ) ? $instance['tooltip'] : $defaults['tooltip'];
		$count = 0;
		foreach ( $options as $option ) {
			$input = 'input' . $count++;
			$select = 'select' . $count++;
			$id = (!empty( $instance[$option['id']] ) ) ? $instance[$option['id']] : '';
			$name = (!empty( $instance[$select] ) ) ? $instance[$select] : '';
			$value = (!empty( $instance[$input] ) ) ? $instance[$input] : '';
			if ( !empty( $value ) && !empty( $name ) ) :
				if ( is_email( $value ) ) :
					$the_value = 'mailto:' . $value;
				elseif ( 'phone' == $name ) :
					$the_value = 'tel:' . $value;
				elseif ( 'skype' == $name ) :
					$the_value = 'skype:' . $value;
				else:
					$the_value = esc_url( $value );
				endif;
				$show_tooltip = ( ! empty( $tooltip ) ) ? 'tooltip' : '';
				$rel_attribute = apply_filters( 'lsi_icon_rel_attribute','rel="nofollow"' );
				$title_attribute = apply_filters( 'lsi_icon_title_attribute','title="' . $options[$name]['name'] . '"' );
				$accessibility = apply_filters( 'lsi_icon_aria_attribute','aria-label="' . $options[$name]['name'] . '"' );
				$output .= sprintf( 
					'<li class="lsi-social-%3$s"><a class="%4$s" %5$s %6$s %7$s href="%1$s" %2$s><i class="lsicon lsicon-%3$s"></i></a></li>',
					$the_value,
					'email' == $name ? '' : $new_window,
					$name,
					$show_tooltip,
					$rel_attribute,
					$title_attribute,
					$accessibility
				);
			endif;
		}
		if ( $output ) :
			printf( 
				'<ul class="lsi-social-icons icon-set-%1$s" style="text-align: %3$s">%2$s</ul>', 
				$unique_id,
				apply_filters( 'lsi_icon_output', $output ),
				$alignment
			);
		endif;
		global $css;
		$css = '
			.icon-set-' . $unique_id . ' a, 
			.icon-set-' . $unique_id . ' a:visited, 
			.icon-set-' . $unique_id . ' a:focus {
				border-radius: ' . $border_radius . 'px;
				background: ' . $background . ' !important;
				color: ' . $color . ' !important;
				font-size: ' . $font_size . 'px !important;
			}
			.icon-set-' . $unique_id . ' a:hover {
				background: ' . $background_hover . ' !important;
				color: ' . $color_hover . ' !important;
			}';
			wp_enqueue_style( 'lsi-style', plugin_dir_url( __FILE__ ) . 'css/style-min.css', array(), LSI_VERSION, 'all' );
			wp_add_inline_style( 'lsi-style', $css, 99 );
		if ( !empty( $tooltip ) ) :
			wp_enqueue_script( 'lsi-tooltipster', plugin_dir_url( __FILE__ ) . 'js/jquery.tooltipster.min.js', array('jquery'), LSI_VERSION, true );
		endif;
		echo $args['after_widget'];
	}
public function widget ( $ args , $ instance ) { $ this -> scripts [ 'lsi_scripts' ] = true ; $ title = apply_filters ( 'widget_title' , $ instance [ 'title' ] ) ; $ options = lsi_icons ( ) ; $ defaults = lsi_option_defaults ( ) ; $ unique_id = $ args [ 'widget_id' ] ; $ output = '' ; echo $ args [ 'before_widget' ] ; echo ( ! empty ( $ title ) ) ? $ args [ 'before_title' ] . $ title . $ args [ 'after_title' ] : '' ; $ new_window = ( isset ( $ instance [ 'new_window' ] ) && '' !== $ instance [ 'new_window' ] ) ? 'target="_blank"' : $ defaults [ 'new_window' ] ; $ font_size = ( isset ( $ instance [ 'font_size' ] ) && '' !== $ instance [ 'font_size' ] ) ? $ instance [ 'font_size' ] : $ defaults [ 'font_size' ] ; $ border_radius = ( isset ( $ instance [ 'border_radius' ] ) && '' !== $ instance [ 'border_radius' ] ) ? $ instance [ 'border_radius' ] : $ defaults [ 'border_radius' ] ; $ background = ( isset ( $ instance [ 'background' ] ) && '' !== $ instance [ 'background' ] ) ? $ instance [ 'background' ] : $ defaults [ 'background' ] ; $ color = ( isset ( $ instance [ 'color' ] ) && '' !== $ instance [ 'color' ] ) ? $ instance [ 'color' ] : $ defaults [ 'color' ] ; $ background_hover = ( isset ( $ instance [ 'background_hover' ] ) && '' !== $ instance [ 'background_hover' ] ) ? $ instance [ 'background_hover' ] : $ defaults [ 'background_hover' ] ; $ color_hover = ( isset ( $ instance [ 'color_hover' ] ) && '' !== $ instance [ 'color_hover' ] ) ? $ instance [ 'color_hover' ] : $ defaults [ 'color_hover' ] ; $ alignment = ( isset ( $ instance [ 'alignment' ] ) && '' !== $ instance [ 'alignment' ] ) ? $ instance [ 'alignment' ] : $ defaults [ 'alignment' ] ; $ tooltip = ( isset ( $ instance [ 'tooltip' ] ) && '' !== $ instance [ 'tooltip' ] ) ? $ instance [ 'tooltip' ] : $ defaults [ 'tooltip' ] ; $ count = 0 ; foreach ( $ options as $ option ) { $ input = 'input' . $ count ++ ; $ select = 'select' . $ count ++ ; $ id = ( ! empty ( $ instance [ $ option [ 'id' ] ] ) ) ? $ instance [ $ option [ 'id' ] ] : '' ; $ name = ( ! empty ( $ instance [ $ select ] ) ) ? $ instance [ $ select ] : '' ; $ value = ( ! empty ( $ instance [ $ input ] ) ) ? $ instance [ $ input ] : '' ; if ( ! empty ( $ value ) && ! empty ( $ name ) ) : if ( is_email ( $ value ) ) : $ the_value = 'mailto:' . $ value ; elseif ( 'phone' == $ name ) : $ the_value = 'tel:' . $ value ; elseif ( 'skype' == $ name ) : $ the_value = 'skype:' . $ value ; else : $ the_value = esc_url ( $ value ) ; endif ; $ show_tooltip = ( ! empty ( $ tooltip ) ) ? 'tooltip' : '' ; $ rel_attribute = apply_filters ( 'lsi_icon_rel_attribute' , 'rel="nofollow"' ) ; $ title_attribute = apply_filters ( 'lsi_icon_title_attribute' , 'title="' . $ options [ $ name ] [ 'name' ] . '"' ) ; $ accessibility = apply_filters ( 'lsi_icon_aria_attribute' , 'aria-label="' . $ options [ $ name ] [ 'name' ] . '"' ) ; $ output .= sprintf ( '<li class="lsi-social-%3$s"><a class="%4$s" %5$s %6$s %7$s href="%1$s" %2$s><i class="lsicon lsicon-%3$s"></i></a></li>' , $ the_value , 'email' == $ name ? '' : $ new_window , $ name , $ show_tooltip , $ rel_attribute , $ title_attribute , $ accessibility ) ; endif ; } if ( $ output ) : printf ( '<ul class="lsi-social-icons icon-set-%1$s" style="text-align: %3$s">%2$s</ul>' , $ unique_id , apply_filters ( 'lsi_icon_output' , $ output ) , $ alignment ) ; endif ; global $ css ; $ css = '
			.icon-set-' . $ unique_id . ' a, 
			.icon-set-' . $ unique_id . ' a:visited, 
			.icon-set-' . $ unique_id . ' a:focus {
				border-radius: ' . $ border_radius . 'px;
				background: ' . $ background . ' !important;
				color: ' . $ color . ' !important;
				font-size: ' . $ font_size . 'px !important;
			}
			.icon-set-' . $ unique_id . ' a:hover {
				background: ' . $ background_hover . ' !important;
				color: ' . $ color_hover . ' !important;
			}' ; wp_enqueue_style ( 'lsi-style' , plugin_dir_url ( __FILE__ ) . 'css/style-min.css' , array ( ) , LSI_VERSION , 'all' ) ; wp_add_inline_style ( 'lsi-style' , $ css , 99 ) ; if ( ! empty ( $ tooltip ) ) : wp_enqueue_script ( 'lsi-tooltipster' , plugin_dir_url ( __FILE__ ) . 'js/jquery.tooltipster.min.js' , array ( 'jquery' ) , LSI_VERSION , true ) ; endif ; echo $ args [ 'after_widget' ] ; }
Front-end display of widget.
Front - end display of widget .