text_fields = array( 'em-social-contacts-title', 'em-social-contacts-subtitle' ); $widget_ops = array( 'classname' => 'elegant_magazine_social_contacts_widget', 'description' => __('Displays social contacts lists from selected settings.', 'elegant-magazine'), 'customize_selective_refresh' => true, ); parent::__construct('elegant_magazine_social_contacts', __('EM Social Contacts', 'elegant-magazine'), $widget_ops ); } /** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ public function widget($args, $instance) { $instance = parent::em_sanitize_data( $instance, $instance ); /** This filter is documented in wp-includes/default-widgets.php */ $title = apply_filters( 'widget_title', $instance['em-social-contacts-title'], $instance, $this->id_base ); $title = isset($title) ? $title : __('EM Social', 'elegant-magazine'); $subtitle = isset($instance['em-social-contacts-subtitle']) ? $instance['em-social-contacts-subtitle'] : ''; // open the widget container echo $args['before_widget']; ?>

"; echo esc_html($social_note); echo "

"; } ?>
'em-social-nav', 'link_before' => '', 'link_after' => '', ) ); } ?>

form_instance = $instance; // generate the text input for the title of the widget. Note that the first parameter matches text_fields array entry echo parent::em_generate_text_input( 'em-social-contacts-title', 'Title', 'EM Social' ); echo parent::em_generate_text_input( 'em-social-contacts-subtitle', 'Subtitle', 'EM Social Subtitle' ); } } endif;