$instance['size'] ) ) . '>';
if ( isset( $this->config['params'] ) AND is_array( $this->config['params'] ) ) {
foreach ( $this->config['params'] as $param_name => $param ) {
if ( in_array(
$param_name, array(
'title',
'size',
'style',
'color',
'shape',
'hover',
'custom_link',
'custom_title',
'custom_icon',
'custom_color',
)
) ) {
// Not all the params are social keys
continue;
}
if ( empty( $instance[$param_name] ) ) {
continue;
}
$param['heading'] = isset( $param['heading'] ) ? $param['heading'] : $param_name;
$social_url = $instance[$param_name];
$social_target = '';
// Email type
if ( $param_name == 'email' ) {
if ( filter_var( $social_url, FILTER_VALIDATE_EMAIL ) ) {
$social_url = 'mailto:' . $social_url;
}
// Skype type
} elseif ( $param_name == 'skype' ) {
if ( strpos( $social_url, ':' ) === FALSE ) {
$social_url = 'skype:' . esc_attr( $social_url );
}
// All others types
} else {
$social_url = esc_url( $social_url );
$social_target = ' target="_blank"';
}
$output .= '
';
}
}
// Custom Link
if ( ( ! empty( $instance['custom_link'] ) ) AND ( ! empty( $instance['custom_icon'] ) ) ) {
$link_style = $hover_style = '';
if ( ! empty( $instance['custom_color'] ) ) {
if ( ! empty( $instance['color'] ) AND $instance['color'] == 'brand' ) {
$link_style = ' style="color: ' . $instance['custom_color'] . ';"';
}
$hover_style = ' style="background: ' . $instance['custom_color'] . ';"';
}
$output .= '
';
}
$output .= '