Title:
$instance['zs1id']); echo dzsvg_shortcode_videogallery($arr); echo $after_widget; } } } add_action( 'widgets_init', function(){ register_widget( 'DZSVG_Showcase_Widget' ); }); class DZSVG_Showcase_Widget extends WP_Widget { /** * Sets up the widgets name etc */ public function __construct() { $widget_ops = array( 'classname' => 'dzsvg_showcase_widget', 'description' => esc_html__('Video Gallery Showcase'), ); parent::__construct( 'dzsvg_showcase_widget', esc_html__('Video Gallery Showcase'), $widget_ops ); } /** * Outputs the content of the widget * * @param array $args * @param array $instance */ public function widget( $args, $instance ) { // outputs the content of the widget echo $args['before_widget']; if ( ! empty( $instance['title'] ) ) { echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ). $args['after_title']; } echo do_shortcode($instance['shortcode']); echo $args['after_widget']; } /** * Outputs the options form on admin * * @param array $instance The widget options */ public function form( $instance ) { $margs = array( 'title'=>'', 'shortcode'=>'', ); if(is_array($instance)){ $margs = array_merge($margs, $instance); } ?>