__( 'Ajouter votre numméro de contact', 'benawp-bootstrap-portfolio' ), 'customize_selective_refresh' => true, ) ); add_action( 'widgets_init', function () { register_widget( 'Benawp_Phone_Number' ); } ); } /** * 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 { echo '0xx xx xxx xx'; // 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 = '0xx xx xxx xx'; // Place holder } ?>