text_fields = array('storecommerce-social-contacts-title', 'storecommerce-social-contacts-subtitle'); $widget_ops = array( 'classname' => 'storecommerce_social_contacts_widget', 'description' => __('Displays social contacts lists from Social Menu items.', 'storecommerce'), 'customize_selective_refresh' => true, ); parent::__construct('storecommerce_social_contacts', __('AFTSC Social Contacts', 'storecommerce'), $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::storecommerce_sanitize_data($instance, $instance); /** This filter is documented in wp-includes/default-widgets.php */ $title = apply_filters('widget_title', $instance['storecommerce-social-contacts-title'], $instance, $this->id_base); $title = isset($title) ? $title : __('Social Contacts', 'storecommerce'); $subtitle = isset($instance['storecommerce-social-contacts-subtitle']) ? $instance['storecommerce-social-contacts-subtitle'] : 'Social Contacts Subtitle'; // open the widget container echo $args['before_widget']; ?>

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::storecommerce_generate_text_input('storecommerce-social-contacts-title', 'Title', 'StoreCommerce Social Contacts'); echo parent::storecommerce_generate_text_input('storecommerce-social-contacts-subtitle', 'Subtitle', 'Social Contacts Subtitle'); } } endif;