'', 'text' => '', 'links' => array(), 'fields' => array(), ); public static $social_icons = array(); /* Widget setup */ function __construct() { /* Widget settings. */ $widget_ops = array( 'description' => _x( 'Contact info', 'widget', 'the7mk2' ) ); /* Create the widget. */ parent::__construct( 'presscore-contact-info-widget', DT_WIDGET_PREFIX . _x( 'Contact info', 'widget', 'the7mk2' ), $widget_ops ); if ( function_exists('presscore_get_social_icons_data') ) { self::$social_icons = presscore_get_social_icons_data(); } } /* Display the widget */ function widget( $args, $instance ) { extract( $args ); $instance = wp_parse_args( (array) $instance, self::$widget_defaults ); /* Our variables from the widget settings. */ $title = apply_filters( 'widget_title', $instance['title'] ); $text = $instance['text']; $links = $instance['links']; $fields = $instance['fields']; echo $before_widget ; // title if ( $title ) echo $before_title . $title . $after_title; // content if ( $text ) echo '
'; // fields if ( !empty($fields) ) { echo '' . __( 'Find us on:', 'the7mk2' ) . '
'; foreach ( $links as $class=>$link ) { if ( !$link ) continue; $title = ( isset( self::$social_icons[ $class ] ) ? self::$social_icons[ $class ] : '' ); echo presscore_get_social_icon( $class, $link, $title ); } echo '
$title ) : $val = isset($links[ $class ]) ? esc_attr($links[ $class ]) : ''; ?>