Index: include/counterwidget.php
===================================================================
--- include/counterwidget.php (revision 1228025)
+++ include/counterwidget.php (working copy)
@@ -3,34 +3,34 @@
/**
Declares the S2_Counter_widget class.
*/
- function S2_Counter_widget() {
- $widget_options = array('classname' => 's2_counter', 'description' => __('Subscriber Counter widget for Subscribe2', 'subscribe2') );
- $control_options = array('width' => 250, 'height' => 500);
- $this->WP_Widget('s2_counter', __('Subscribe2 Counter', 'subscribe2'), $widget_options, $control_options);
+ function __construct() {
+ $widget_options = array( 'classname' => 's2_counter', 'description' => esc_html__( 'Subscriber Counter widget for Subscribe2', 'subscribe2' ) );
+ $control_options = array( 'width' => 250, 'height' => 500 );
+ parent::__construct( 's2_counter', esc_html__( 'Subscribe2 Counter', 'subscribe2' ), $widget_options, $control_options );
}
/**
Displays the Widget
*/
- function widget($args, $instance) {
- $title = empty($instance['title']) ? 'Subscriber Count' : $instance['title'];
- $s2w_bg = empty($instance['s2w_bg']) ? '#e3dacf' : $instance['s2w_bg'];
- $s2w_fg = empty($instance['s2w_fg']) ? '#345797' : $instance['s2w_fg'];
- $s2w_width = empty($instance['s2w_width']) ? '82' : $instance['s2w_width'];
- $s2w_height = empty($instance['s2w_height']) ? '16' : $instance['s2w_height'];
- $s2w_font = empty($instance['s2w_font']) ? '11' : $instance['s2w_font'];
+ function widget( $args, $instance ) {
+ $title = empty( $instance['title'] ) ? 'Subscriber Count' : $instance['title'];
+ $s2w_bg = empty( $instance['s2w_bg'] ) ? '#e3dacf' : $instance['s2w_bg'];
+ $s2w_fg = empty( $instance['s2w_fg'] ) ? '#345797' : $instance['s2w_fg'];
+ $s2w_width = empty( $instance['s2w_width'] ) ? '82' : $instance['s2w_width'];
+ $s2w_height = empty( $instance['s2w_height'] ) ? '16' : $instance['s2w_height'];
+ $s2w_font = empty( $instance['s2w_font'] ) ? '11' : $instance['s2w_font'];
echo $args['before_widget'];
- if ( !empty($title) ) {
+ if ( ! empty( $title ) ) {
echo $args['before_title'] . $title . $args['after_title'];
}
global $mysubscribe2;
$registered = $mysubscribe2->get_registered();
$confirmed = $mysubscribe2->get_public();
- $count = (count($registered) + count($confirmed));
- echo "
\r\n";
- echo "
\r\n";
- echo "
\r\n";
- echo "
\r\n";
- echo "
\r\n";
- echo "
\r\n";
- echo "
" . __('Display options', 'subscribe2') . ":
\r\n";
- echo "\r\n";
- echo "
\r\n";
- echo "
\r\n";
- if ( '1' == $mysubscribe2->subscribe2_options['ajax'] ) {
- echo "
\r\n";
+ echo '
' . "\r\n";
+ echo '
' . "\r\n";
+ echo '
' . "\r\n";
+ echo '
' . "\r\n";
+ echo '
' . "\r\n";
+ echo '
' . "\r\n";
+ echo '
' . __( 'Display options', 'subscribe2' ) . ':
' . "\r\n";
+ echo '' . "\r\n";
+ echo '
' . "\r\n";
+ echo '
' . "\r\n";
+ if ( '1' === $mysubscribe2->subscribe2_options['ajax'] ) {
+ echo '
' . "\r\n";
}
- echo "
\r\n";
- echo "
\r\n";
- echo "
\r\n";
- echo "
\r\n";
- echo "
\r\n";
- echo "
\r\n";
+ echo '' . "\r\n";
+ echo '
' . "\r\n";
+ echo '
' . "\r\n";
+ echo '
' . "\r\n";
+ echo '
' . "\r\n";
+ echo '
' . "\r\n";
}
} // End S2_Form_widget class
?>
\ No newline at end of file