-// Widget stuff
-function widget_akismet_register() {
- if ( function_exists('register_sidebar_widget') ) :
- function widget_akismet($args) {
- extract($args);
- $options = get_option('widget_akismet');
- $count = get_option('akismet_spam_count');
- ?>
- <?php echo $before_widget; ?>
- <?php echo $before_title . $options['title'] . $after_title; ?>
- <div id="akismetwrap"><div id="akismetstats"><a id="aka" href="http://akismet.com" title=""><?php printf( _n( '%1$s%2$s%3$s %4$sspam comment%5$s %6$sblocked by%7$s<br />%8$sAkismet%9$s', '%1$s%2$s%3$s %4$sspam comments%5$s %6$sblocked by%7$s<br />%8$sAkismet%9$s', $count ), '<span id="akismet1"><span id="akismetcount">', number_format_i18n( $count ), '</span>', '<span id="akismetsc">', '</span></span>', '<span id="akismet2"><span id="akismetbb">', '</span>', '<span id="akismeta">', '</span></span>' ); ?></a></div></div>
- <?php echo $after_widget; ?>
- <?php
+class Akismet_Widget extends WP_Widget {
+
+ function __construct() {
+ parent::__construct(
+ 'akismet_widget',
+ __( 'Akismet Widget' ),
+ array( 'description' => __( 'Display the number of spam comments Akismet has caught' ) )
+ );
+
+ if ( is_active_widget( false, false, $this->id_base ) ) {
+ add_action( 'wp_head', array( $this, 'css' ) );
+ }