60 |
60 |
61 <?php |
61 <?php |
62 } |
62 } |
63 |
63 |
64 function form( $instance ) { |
64 function form( $instance ) { |
65 if ( $instance ) { |
65 if ( $instance && isset( $instance['title'] ) ) { |
66 $title = $instance['title']; |
66 $title = $instance['title']; |
67 } |
67 } |
68 else { |
68 else { |
69 $title = __( 'Spam Blocked' , 'akismet'); |
69 $title = __( 'Spam Blocked' , 'akismet' ); |
70 } |
70 } |
71 ?> |
71 ?> |
72 |
72 |
73 <p> |
73 <p> |
74 <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php esc_html_e( 'Title:' , 'akismet'); ?></label> |
74 <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php esc_html_e( 'Title:' , 'akismet'); ?></label> |
84 } |
84 } |
85 |
85 |
86 function widget( $args, $instance ) { |
86 function widget( $args, $instance ) { |
87 $count = get_option( 'akismet_spam_count' ); |
87 $count = get_option( 'akismet_spam_count' ); |
88 |
88 |
|
89 if ( ! isset( $instance['title'] ) ) { |
|
90 $instance['title'] = __( 'Spam Blocked' , 'akismet' ); |
|
91 } |
|
92 |
89 echo $args['before_widget']; |
93 echo $args['before_widget']; |
90 if ( ! empty( $instance['title'] ) ) { |
94 if ( ! empty( $instance['title'] ) ) { |
91 echo $args['before_title']; |
95 echo $args['before_title']; |
92 echo esc_html( $instance['title'] ); |
96 echo esc_html( $instance['title'] ); |
93 echo $args['after_title']; |
97 echo $args['after_title']; |
94 } |
98 } |
95 ?> |
99 ?> |
96 |
100 |
97 <div class="a-stats"> |
101 <div class="a-stats"> |
98 <a href="http://akismet.com" target="_blank" title=""><?php printf( _n( '<strong class="count">%1$s spam</strong> blocked by <strong>Akismet</strong>', '<strong class="count">%1$s spam</strong> blocked by <strong>Akismet</strong>', $count , 'akismet'), number_format_i18n( $count ) ); ?></a> |
102 <a href="https://akismet.com" target="_blank" title=""><?php printf( _n( '<strong class="count">%1$s spam</strong> blocked by <strong>Akismet</strong>', '<strong class="count">%1$s spam</strong> blocked by <strong>Akismet</strong>', $count , 'akismet'), number_format_i18n( $count ) ); ?></a> |
99 </div> |
103 </div> |
100 |
104 |
101 <?php |
105 <?php |
102 echo $args['after_widget']; |
106 echo $args['after_widget']; |
103 } |
107 } |