__( 'Ajouter votre e-mail', 'benawp-bootstrap-portfolio' ), 'customize_selective_refresh' => true, ) ); add_action( 'widgets_init', function () { register_widget( 'Benawp_Mail' ); } ); } /** * Front-end display of widget. * * @param array $args Widget arguments. * @param array $instance Saved values from database. * * @see WP_Widget::widget() * */ public function widget( $args, $instance ) { extract( $args ); $title = apply_filters( 'widget_title', $instance['title'] ); echo $before_widget; if ( ! empty( $title ) ) { echo $title; } else { esc_html_e( 'votre@email.com', 'benawp-bootstrap-portfolio' ); // In case the user does not put anything } echo $after_widget; } /** * Back-end widget form. * * @param array $instance Previously saved values from database. * * @see WP_Widget::form() * */ public function form( $instance ) { if ( isset( $instance['title'] ) ) { $title = $instance['title']; } else { $title = esc_html__( 'votre@email.com', 'benawp-bootstrap-portfolio' ); // Place holder } ?>