'', 'form_id' => '' ); /** * Register widget with WordPress. */ function __construct() { // translate default widget title $this->default_instance_settings['title'] = __( 'Newsletter', 'mailchimp-for-wp' ); parent::__construct( 'mc4wp_form_widget', // Base ID __( 'MailChimp Sign-Up Form', 'mailchimp-for-wp' ), // Name array( 'description' => __( 'Displays your MailChimp for WordPress sign-up form', 'mailchimp-for-wp' ), ) ); } /** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance_settings Saved values from database. */ public function widget( $args, $instance_settings ) { // ensure $instance_settings is an array if( ! is_array( $instance_settings ) ) { $instance_settings = array(); } $instance_settings = array_merge( $this->default_instance_settings, $instance_settings ); $title = apply_filters( 'widget_title', $instance_settings['title'] ); echo $args['before_widget']; if ( ! empty( $title ) ) { echo $args['before_title'] . $title . $args['after_title']; } mc4wp_show_form( $instance_settings['form_id'] ); echo $args['after_widget']; } /** * Back-end widget form. * * @see WP_Widget::form() * * @param array $settings Previously saved values from database. * * @return string|void */ public function form( $settings ) { $settings = array_merge( $this->default_instance_settings, (array) $settings ); ?>

MailChimp for WordPress form settings.', 'mailchimp-for-wp' ), admin_url( 'admin.php?page=mailchimp-for-wp-forms' ) ); ?>