Juraj Puchký Author URI: http://www.devtech.cz/ */ class AdsContent_Widget extends WP_Widget { /** constructor */ function AdsContent_Widget() { parent::WP_Widget('', __('Ads Content', 'ads-content'), array('description' => __('Help users to put advertisment content as widget.', 'ads-content')), array('width' => 400)); } /** Backwards compatibility for AdsContent_Widget::display(); usage */ function display($args = false) { self::widget($args, NULL); } /** @see WP_Widget::widget */ function widget($args = array(), $instance) { $defaults = array( 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '', ); $args = wp_parse_args($args, $defaults); extract($args); $title = (isset($instance) && isset($instance['title'])) ? esc_attr($instance['title']) : ''; $adContent = (isset($instance) && isset($instance['adcontent'])) ? $instance['adcontent'] : ''; $poweredby = (isset($instance) && isset($instance['poweredby'])) ? esc_attr($instance['poweredby']) : ''; echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } // Dynamic content of widget echo "\n" . $adContent . "\n"; // // Devtech ad if($poweredby) { ?>
value="poweredby" />