widget_cssclass = 'bloglex_youtube_video'; $this->widget_description = __('Displays youtube video form your channel.', 'bloglex'); $this->widget_id = 'bloglex_youtube_video'; $this->widget_name = __('Bloglex: Youtube Video', 'bloglex'); $this->settings = $this->get_widget_settings(); parent::__construct(); } /** * Define widget settings. */ protected function get_widget_settings() { return array( 'title' => array( 'type' => 'text', 'label' => __('Title', 'bloglex'), ), 'channel_url' => array( 'type' => 'url', 'label' => __('Channel URL:', 'bloglex'), 'desc' => __('Please make sure to provide a complete URL that includes either "http://" or "https://" to ensure the widget operates correctly.', 'bloglex'), ), 'channel_name' => array( 'type' => 'text', 'label' => __('Channel Name:', 'bloglex'), ), 'video_url' => array( 'type' => 'url', 'label' => __('Video URL:', 'bloglex'), 'desc' => __('Please make sure to provide a complete URL that includes either "http://" or "https://" to ensure the widget operates correctly.', 'bloglex'), ), ); } /** * Output widget. * * @param array $args * @param array $instance * @see WP_Widget * */ public function widget($args, $instance) { ob_start(); $channel_url = isset($instance['channel_url']) ? $instance['channel_url'] : $this->settings['channel_url']['std']; $channel_name = isset($instance['channel_name']) ? $instance['channel_name'] : $this->settings['channel_name']['std']; $video_url = isset($instance['video_url']) ? $instance['video_url'] : $this->settings['video_url']['std']; $this->widget_start($args, $instance); ?>
@
widget_end($args); echo ob_get_clean(); } }