From dba1213f8db859753efc42112bd3236c3f51f8ab Mon Sep 17 00:00:00 2001 From: ulaulaman Date: Fri, 23 Oct 2020 22:44:30 +0200 Subject: [PATCH] Aggiunto widget sidebar costellazioni --- sidebars/widgets.php | 53 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/sidebars/widgets.php b/sidebars/widgets.php index 8e9811f..00725e6 100644 --- a/sidebars/widgets.php +++ b/sidebars/widgets.php @@ -54,4 +54,57 @@ add_action( 'widgets_init', 'register_dida' ); function register_dida() { register_widget( 'Widget_Didattica' ); +} + +# costellazioni +class Widget_Stars extends WP_Widget { + + /** Registrazione del widget */ + public function __construct() { + parent::__construct( + 'widget_stars', // Base ID + 'Widget Stars', // Name + array( 'description' => __( 'Widget per l\'inserimento della sidebar delle costellazioni', 'text_domain' ), ) // Args + ); + } + + /** Front-end display of widget */ + public function widget( $args, $instance ) { + extract( $args ); + $shortcode = do_shortcode('[sbcostellazioni]'); + echo $shortcode; + echo $after_widget; + } + + /** Back-end widget form */ + public function form( $instance ) { + if ( isset( $instance[ 'title' ] ) ) { + $title = $instance[ 'title' ]; + } + else { + $title = __( 'Titolo', 'text_domain' ); + } + ?> +

+ + +

+