Version Description
September 5, 2017 =
Enhancement: Code improvements.
Download this release
Release Info
Developer | designorbital |
Plugin | Easy Twitter Feed Widget Plugin |
Version | 0.7 |
Comparing to | |
See all releases |
Code changes from version 0.6 to 0.7
- easy-twitter-feed-widget.php +2 -2
- inc/widget-twitter.php +121 -116
- readme.txt +7 -3
easy-twitter-feed-widget.php
CHANGED
@@ -7,11 +7,11 @@ Author: DesignOrbital.com
|
|
7 |
Author URI: https://designorbital.com
|
8 |
Text Domain: do-etfw
|
9 |
Domain Path: /languages/
|
10 |
-
Version: 0.
|
11 |
License: GPL v3
|
12 |
|
13 |
Easy Twitter Feed Widget Plugin
|
14 |
-
Copyright (C) 2012-
|
15 |
|
16 |
This program is free software: you can redistribute it and/or modify
|
17 |
it under the terms of the GNU General Public License as published by
|
7 |
Author URI: https://designorbital.com
|
8 |
Text Domain: do-etfw
|
9 |
Domain Path: /languages/
|
10 |
+
Version: 0.7
|
11 |
License: GPL v3
|
12 |
|
13 |
Easy Twitter Feed Widget Plugin
|
14 |
+
Copyright (C) 2012-2017, DesignOrbital.com
|
15 |
|
16 |
This program is free software: you can redistribute it and/or modify
|
17 |
it under the terms of the GNU General Public License as published by
|
inc/widget-twitter.php
CHANGED
@@ -16,59 +16,96 @@ function do_etfw_widget_init() {
|
|
16 |
}
|
17 |
|
18 |
/**
|
19 |
-
*
|
|
|
20 |
*/
|
21 |
class DO_ETFW_Widget extends WP_Widget {
|
22 |
|
23 |
/**
|
24 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
*/
|
26 |
public function __construct() {
|
27 |
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
apply_filters( 'do_etfw_widget_name', esc_html__( 'Twitter Timeline (Easy Twitter Feed Widget)', 'do-etfw' ) ),
|
31 |
-
|
32 |
-
'classname' => 'widget-do-etfw',
|
33 |
-
'description' => esc_html__( 'Display an official Twitter Embedded Timeline widget.', 'do-etfw' )
|
34 |
-
)
|
35 |
);
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
}
|
40 |
|
41 |
}
|
42 |
|
43 |
/**
|
44 |
-
* Enqueue scripts
|
45 |
*/
|
46 |
public function enqueue_scripts() {
|
47 |
-
|
|
|
|
|
|
|
|
|
48 |
}
|
49 |
|
50 |
/**
|
51 |
-
*
|
52 |
*
|
53 |
-
* @
|
54 |
-
*
|
55 |
-
* @param array $
|
56 |
-
* @param array $instance Saved values from database.
|
57 |
*/
|
58 |
function widget( $args, $instance ) {
|
59 |
|
60 |
-
//
|
61 |
-
$
|
62 |
|
63 |
-
|
64 |
-
$
|
65 |
|
66 |
// Open the output of the widget.
|
67 |
echo $args['before_widget'];
|
68 |
|
69 |
?>
|
70 |
-
<?php if ( ! empty( $
|
71 |
-
<?php echo $args['before_title'] .
|
72 |
<?php endif; ?>
|
73 |
|
74 |
<?php
|
@@ -124,14 +161,12 @@ class DO_ETFW_Widget extends WP_Widget {
|
|
124 |
}
|
125 |
|
126 |
/**
|
127 |
-
*
|
128 |
-
*
|
129 |
-
* @see WP_Widget::update()
|
130 |
*
|
131 |
-
* @param array $new_instance
|
132 |
-
*
|
133 |
-
*
|
134 |
-
* @return array
|
135 |
*/
|
136 |
public function update( $new_instance, $old_instance ) {
|
137 |
|
@@ -139,11 +174,11 @@ class DO_ETFW_Widget extends WP_Widget {
|
|
139 |
$instance = $old_instance;
|
140 |
|
141 |
// Sanitization
|
142 |
-
$instance['title'] =
|
143 |
|
144 |
$instance['twitter_timeline_type'] = $new_instance['twitter_timeline_type'];
|
145 |
-
if ( !
|
146 |
-
$instance['twitter_timeline_type'] = '
|
147 |
}
|
148 |
|
149 |
$instance['twitter_widget_username'] = sanitize_text_field( $new_instance['twitter_widget_username'] );
|
@@ -169,8 +204,8 @@ class DO_ETFW_Widget extends WP_Widget {
|
|
169 |
$instance['twitter_widget_tweet_limit'] = ( $twitter_widget_tweet_limit ? $twitter_widget_tweet_limit : null );
|
170 |
|
171 |
$instance['twitter_widget_theme'] = $new_instance['twitter_widget_theme'];
|
172 |
-
if ( !
|
173 |
-
$instance['twitter_widget_theme'] = '
|
174 |
}
|
175 |
|
176 |
$instance['twitter_widget_link_color'] = sanitize_hex_color( $new_instance['twitter_widget_link_color'] );
|
@@ -197,110 +232,101 @@ class DO_ETFW_Widget extends WP_Widget {
|
|
197 |
}
|
198 |
|
199 |
/**
|
200 |
-
*
|
201 |
-
*
|
202 |
-
* @see WP_Widget::form()
|
203 |
*
|
204 |
-
* @
|
205 |
*/
|
206 |
-
function
|
207 |
-
|
208 |
-
// Defaults
|
209 |
-
$defaults = $this->defaults();
|
210 |
-
|
211 |
-
// Merge the user-selected arguments with the defaults.
|
212 |
-
$instance = wp_parse_args( (array) $instance, $defaults );
|
213 |
|
214 |
-
//
|
215 |
-
$twitter_timeline_type = array (
|
216 |
'username' => esc_html__( 'Username', 'do-etfw'),
|
217 |
'widget-id' => esc_html__( 'Widget ID', 'do-etfw'),
|
218 |
);
|
219 |
|
220 |
-
|
|
|
221 |
'light' => esc_html__( 'Light', 'do-etfw'),
|
222 |
'dark' => esc_html__( 'Dark', 'do-etfw'),
|
223 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
?>
|
225 |
|
226 |
<p>
|
227 |
-
<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>">
|
228 |
-
|
229 |
-
<input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" />
|
230 |
-
</label>
|
231 |
</p>
|
232 |
|
233 |
<p>
|
234 |
-
<label for="<?php echo $this->get_field_id( 'twitter_timeline_type' ); ?>">
|
235 |
-
|
236 |
-
|
237 |
-
</label>
|
238 |
-
<select class="widefat" name="<?php echo $this->get_field_name( 'twitter_timeline_type' ); ?>" id="<?php echo $this->get_field_id( 'twitter_timeline_type' ); ?>">
|
239 |
-
<?php foreach ( $twitter_timeline_type as $key => $val ): ?>
|
240 |
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $instance['twitter_timeline_type'], $key ); ?>><?php echo esc_html( $val ); ?></option>
|
241 |
<?php endforeach; ?>
|
242 |
</select>
|
243 |
</p>
|
244 |
|
245 |
<p>
|
246 |
-
<label for="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_username' ) ); ?>">
|
247 |
-
|
248 |
-
<input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_username' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'twitter_widget_username' ) ); ?>" value="<?php echo esc_attr( $instance['twitter_widget_username'] ); ?>" />
|
249 |
-
</label>
|
250 |
</p>
|
251 |
|
252 |
<p>
|
253 |
-
<label for="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_id' ) ); ?>">
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
</label>
|
258 |
</p>
|
259 |
|
260 |
<p>
|
261 |
-
<label for="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_width' ) ); ?>">
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
</p>
|
266 |
|
267 |
<p>
|
268 |
-
<label for="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_height' ) ); ?>">
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
</p>
|
273 |
|
274 |
<p>
|
275 |
-
<label for="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_tweet_limit' ) ); ?>">
|
276 |
-
|
277 |
-
<input type="number" min="1" max="20" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_tweet_limit' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'twitter_widget_tweet_limit' ) ); ?>" value="<?php echo esc_attr( $instance['twitter_widget_tweet_limit'] ); ?>" />
|
278 |
-
</label>
|
279 |
</p>
|
280 |
|
281 |
<p>
|
282 |
-
<label for="<?php echo $this->get_field_id( 'twitter_widget_theme' ); ?>">
|
283 |
-
|
284 |
-
|
285 |
-
<select class="widefat" name="<?php echo $this->get_field_name( 'twitter_widget_theme' ); ?>" id="<?php echo $this->get_field_id( 'twitter_widget_theme' ); ?>">
|
286 |
-
<?php foreach ( $twitter_widget_theme as $key => $val ): ?>
|
287 |
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $instance['twitter_widget_theme'], $key ); ?>><?php echo esc_html( $val ); ?></option>
|
288 |
<?php endforeach; ?>
|
289 |
</select>
|
290 |
</p>
|
291 |
|
292 |
<p>
|
293 |
-
<label for="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_link_color' ) ); ?>">
|
294 |
-
|
295 |
-
<input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_link_color' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'twitter_widget_link_color' ) ); ?>" value="<?php echo esc_attr( $instance['twitter_widget_link_color'] ); ?>" />
|
296 |
-
</label>
|
297 |
</p>
|
298 |
|
299 |
<p>
|
300 |
-
<label for="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_border_color' ) ); ?>">
|
301 |
-
|
302 |
-
<input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_border_color' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'twitter_widget_border_color' ) ); ?>" value="<?php echo esc_attr( $instance['twitter_widget_border_color'] ); ?>" />
|
303 |
-
</label>
|
304 |
</p>
|
305 |
|
306 |
<p>
|
@@ -337,25 +363,4 @@ class DO_ETFW_Widget extends WP_Widget {
|
|
337 |
<?php
|
338 |
}
|
339 |
|
340 |
-
|
341 |
-
public function defaults() {
|
342 |
-
|
343 |
-
$defaults = array(
|
344 |
-
'title' => esc_html__( 'Follow me on Twitter', 'do-etfw' ),
|
345 |
-
'twitter_timeline_type' => 'username',
|
346 |
-
'twitter_widget_username' => 'DesignOrbital',
|
347 |
-
'twitter_widget_id' => '',
|
348 |
-
'twitter_widget_width' => '',
|
349 |
-
'twitter_widget_height' => 400,
|
350 |
-
'twitter_widget_tweet_limit' => null,
|
351 |
-
'twitter_widget_theme' => 'light',
|
352 |
-
'twitter_widget_link_color' => '#3b94d9',
|
353 |
-
'twitter_widget_border_color' => '#f5f5f5',
|
354 |
-
'twitter_widget_chrome' => array(),
|
355 |
-
);
|
356 |
-
|
357 |
-
return $defaults;
|
358 |
-
|
359 |
-
}
|
360 |
-
|
361 |
-
}
|
16 |
}
|
17 |
|
18 |
/**
|
19 |
+
* Core class used to implement a widget.
|
20 |
+
* @see WP_Widget
|
21 |
*/
|
22 |
class DO_ETFW_Widget extends WP_Widget {
|
23 |
|
24 |
/**
|
25 |
+
* Default instance.
|
26 |
+
*/
|
27 |
+
protected $default_instance;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Form Options
|
31 |
+
*/
|
32 |
+
protected $twitter_timeline_type;
|
33 |
+
protected $twitter_widget_theme;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Sets up a new widget instance.
|
37 |
*/
|
38 |
public function __construct() {
|
39 |
|
40 |
+
// Initialize Default Instance
|
41 |
+
$this->default_instance = array (
|
42 |
+
'title' => esc_html__( 'Follow me on Twitter', 'do-etfw' ),
|
43 |
+
'twitter_timeline_type' => 'username',
|
44 |
+
'twitter_widget_username' => 'DesignOrbital',
|
45 |
+
'twitter_widget_id' => '',
|
46 |
+
'twitter_widget_width' => '',
|
47 |
+
'twitter_widget_height' => 400,
|
48 |
+
'twitter_widget_tweet_limit' => null,
|
49 |
+
'twitter_widget_theme' => 'light',
|
50 |
+
'twitter_widget_link_color' => '#3b94d9',
|
51 |
+
'twitter_widget_border_color' => '#f5f5f5',
|
52 |
+
'twitter_widget_chrome' => array(),
|
53 |
+
);
|
54 |
+
|
55 |
+
// Initialize Form Options
|
56 |
+
$this->set_form_options();
|
57 |
+
|
58 |
+
// Widget Options
|
59 |
+
$widget_ops = array (
|
60 |
+
'classname' => 'widget-do-etfw',
|
61 |
+
'description' => esc_html__( 'Display an official Twitter Embedded Timeline widget.', 'do-etfw' ),
|
62 |
+
'customize_selective_refresh' => true,
|
63 |
+
);
|
64 |
+
|
65 |
+
// Constructor
|
66 |
+
parent::__construct (
|
67 |
+
'do-etfw', // ID
|
68 |
apply_filters( 'do_etfw_widget_name', esc_html__( 'Twitter Timeline (Easy Twitter Feed Widget)', 'do-etfw' ) ),
|
69 |
+
$widget_ops
|
|
|
|
|
|
|
70 |
);
|
71 |
|
72 |
+
// Scripts
|
73 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
|
|
74 |
|
75 |
}
|
76 |
|
77 |
/**
|
78 |
+
* Enqueue scripts
|
79 |
*/
|
80 |
public function enqueue_scripts() {
|
81 |
+
|
82 |
+
if ( do_etfw_option( 'twitter_script' ) ) {
|
83 |
+
wp_enqueue_script( 'do-etfw-twitter-widgets', DO_ETFW_URI . '/js/twitter-widgets.js', array( 'jquery' ), '1.0', true );
|
84 |
+
}
|
85 |
+
|
86 |
}
|
87 |
|
88 |
/**
|
89 |
+
* Outputs the content for the current widget instance.
|
90 |
*
|
91 |
+
* @param array $args Display arguments including 'before_title', 'after_title',
|
92 |
+
* 'before_widget', and 'after_widget'.
|
93 |
+
* @param array $instance Settings for the current Custom HTML widget instance.
|
|
|
94 |
*/
|
95 |
function widget( $args, $instance ) {
|
96 |
|
97 |
+
// Merge the instance arguments with the defaults.
|
98 |
+
$instance = wp_parse_args( (array) $instance, $this->default_instance );
|
99 |
|
100 |
+
/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
|
101 |
+
$title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
|
102 |
|
103 |
// Open the output of the widget.
|
104 |
echo $args['before_widget'];
|
105 |
|
106 |
?>
|
107 |
+
<?php if ( ! empty ( $title ) ) : ?>
|
108 |
+
<?php echo $args['before_title'] . $title . $args['after_title']; ?>
|
109 |
<?php endif; ?>
|
110 |
|
111 |
<?php
|
161 |
}
|
162 |
|
163 |
/**
|
164 |
+
* Handles updating settings for the current widget instance.
|
|
|
|
|
165 |
*
|
166 |
+
* @param array $new_instance New settings for this instance as input by the user via
|
167 |
+
* WP_Widget::form().
|
168 |
+
* @param array $old_instance Old settings for this instance.
|
169 |
+
* @return array Settings to save or bool false to cancel saving.
|
170 |
*/
|
171 |
public function update( $new_instance, $old_instance ) {
|
172 |
|
174 |
$instance = $old_instance;
|
175 |
|
176 |
// Sanitization
|
177 |
+
$instance['title'] = sanitize_text_field( $new_instance['title'] );
|
178 |
|
179 |
$instance['twitter_timeline_type'] = $new_instance['twitter_timeline_type'];
|
180 |
+
if ( ! array_key_exists( $instance['twitter_timeline_type'], $this->twitter_timeline_type ) ) {
|
181 |
+
$instance['twitter_timeline_type'] = $this->default_instance['twitter_timeline_type'];
|
182 |
}
|
183 |
|
184 |
$instance['twitter_widget_username'] = sanitize_text_field( $new_instance['twitter_widget_username'] );
|
204 |
$instance['twitter_widget_tweet_limit'] = ( $twitter_widget_tweet_limit ? $twitter_widget_tweet_limit : null );
|
205 |
|
206 |
$instance['twitter_widget_theme'] = $new_instance['twitter_widget_theme'];
|
207 |
+
if ( ! array_key_exists( $instance['twitter_widget_theme'], $this->twitter_widget_theme ) ) {
|
208 |
+
$instance['twitter_widget_theme'] = $this->default_instance['twitter_widget_theme'];
|
209 |
}
|
210 |
|
211 |
$instance['twitter_widget_link_color'] = sanitize_hex_color( $new_instance['twitter_widget_link_color'] );
|
232 |
}
|
233 |
|
234 |
/**
|
235 |
+
* Set Form Options
|
|
|
|
|
236 |
*
|
237 |
+
* @returns void
|
238 |
*/
|
239 |
+
public function set_form_options() {
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
|
241 |
+
// Timeline Type
|
242 |
+
$this->twitter_timeline_type = array (
|
243 |
'username' => esc_html__( 'Username', 'do-etfw'),
|
244 |
'widget-id' => esc_html__( 'Widget ID', 'do-etfw'),
|
245 |
);
|
246 |
|
247 |
+
// Widget Theme
|
248 |
+
$this->twitter_widget_theme = array (
|
249 |
'light' => esc_html__( 'Light', 'do-etfw'),
|
250 |
'dark' => esc_html__( 'Dark', 'do-etfw'),
|
251 |
);
|
252 |
+
|
253 |
+
}
|
254 |
+
|
255 |
+
/**
|
256 |
+
* Outputs the widget settings form.
|
257 |
+
*
|
258 |
+
* @param array $instance Current instance.
|
259 |
+
* @returns void
|
260 |
+
*/
|
261 |
+
function form( $instance ) {
|
262 |
+
|
263 |
+
// Merge the instance arguments with the defaults.
|
264 |
+
$instance = wp_parse_args( (array) $instance, $this->default_instance );
|
265 |
+
|
266 |
?>
|
267 |
|
268 |
<p>
|
269 |
+
<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title:', 'do-etfw' ); ?></label>
|
270 |
+
<input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" />
|
|
|
|
|
271 |
</p>
|
272 |
|
273 |
<p>
|
274 |
+
<label for="<?php echo esc_attr( $this->get_field_id( 'twitter_timeline_type' ) ); ?>"><?php esc_html_e( 'Timeline Type:', 'do-etfw' ); ?></label>
|
275 |
+
<select class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'twitter_timeline_type' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'twitter_timeline_type' ) ); ?>">
|
276 |
+
<?php foreach ( $this->twitter_timeline_type as $key => $val ): ?>
|
|
|
|
|
|
|
277 |
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $instance['twitter_timeline_type'], $key ); ?>><?php echo esc_html( $val ); ?></option>
|
278 |
<?php endforeach; ?>
|
279 |
</select>
|
280 |
</p>
|
281 |
|
282 |
<p>
|
283 |
+
<label for="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_username' ) ); ?>"><?php esc_html_e( 'Twitter Username:', 'do-etfw' ); ?></label>
|
284 |
+
<input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_username' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'twitter_widget_username' ) ); ?>" value="<?php echo esc_attr( $instance['twitter_widget_username'] ); ?>" />
|
|
|
|
|
285 |
</p>
|
286 |
|
287 |
<p>
|
288 |
+
<label for="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_id' ) ); ?>"><?php esc_html_e( 'Widget ID:', 'do-etfw' ); ?></label>
|
289 |
+
<input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_id' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'twitter_widget_id' ) ); ?>" value="<?php echo esc_attr( $instance['twitter_widget_id'] ); ?>" />
|
290 |
+
<br />
|
291 |
+
<small><?php echo esc_html__( 'It can be empty, if you are using Timeline Type "Username".', 'do-etfw' ); ?></small>
|
|
|
292 |
</p>
|
293 |
|
294 |
<p>
|
295 |
+
<label for="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_width' ) ); ?>"><?php esc_html_e( 'Maximum Width:', 'do-etfw' ); ?></label>
|
296 |
+
<input type="number" min="220" max="1200" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_width' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'twitter_widget_width' ) ); ?>" value="<?php echo esc_attr( $instance['twitter_widget_width'] ); ?>" />
|
297 |
+
<br />
|
298 |
+
<small><?php echo esc_html__( 'px; 220 to 1200', 'do-etfw' ); ?></small>
|
299 |
</p>
|
300 |
|
301 |
<p>
|
302 |
+
<label for="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_height' ) ); ?>"><?php esc_html_e( 'Height:', 'do-etfw' ); ?></label>
|
303 |
+
<input type="number" min="200" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_height' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'twitter_widget_height' ) ); ?>" value="<?php echo esc_attr( $instance['twitter_widget_height'] ); ?>" />
|
304 |
+
<br />
|
305 |
+
<small><?php echo esc_html__( 'px; at least 200', 'do-etfw' ); ?></small>
|
306 |
</p>
|
307 |
|
308 |
<p>
|
309 |
+
<label for="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_tweet_limit' ) ); ?>"><?php esc_html_e( 'Number of Tweets Shown:', 'do-etfw' ); ?></label>
|
310 |
+
<input type="number" min="1" max="20" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_tweet_limit' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'twitter_widget_tweet_limit' ) ); ?>" value="<?php echo esc_attr( $instance['twitter_widget_tweet_limit'] ); ?>" />
|
|
|
|
|
311 |
</p>
|
312 |
|
313 |
<p>
|
314 |
+
<label for="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_theme' ) ); ?>"><?php esc_html_e( 'Theme:', 'do-etfw' ); ?></label>
|
315 |
+
<select class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_theme' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'twitter_widget_theme' ) ); ?>">
|
316 |
+
<?php foreach ( $this->twitter_widget_theme as $key => $val ): ?>
|
|
|
|
|
317 |
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $instance['twitter_widget_theme'], $key ); ?>><?php echo esc_html( $val ); ?></option>
|
318 |
<?php endforeach; ?>
|
319 |
</select>
|
320 |
</p>
|
321 |
|
322 |
<p>
|
323 |
+
<label for="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_link_color' ) ); ?>"><?php esc_html_e( 'Link Color (hex):', 'do-etfw' ); ?></label>
|
324 |
+
<input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_link_color' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'twitter_widget_link_color' ) ); ?>" value="<?php echo esc_attr( $instance['twitter_widget_link_color'] ); ?>" />
|
|
|
|
|
325 |
</p>
|
326 |
|
327 |
<p>
|
328 |
+
<label for="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_border_color' ) ); ?>"><?php esc_html_e( 'Border Color (hex):', 'do-etfw' ); ?></label>
|
329 |
+
<input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'twitter_widget_border_color' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'twitter_widget_border_color' ) ); ?>" value="<?php echo esc_attr( $instance['twitter_widget_border_color'] ); ?>" />
|
|
|
|
|
330 |
</p>
|
331 |
|
332 |
<p>
|
363 |
<?php
|
364 |
}
|
365 |
|
366 |
+
} // End Class DO_ETFW_Widget
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -3,9 +3,9 @@ Contributors: designorbital
|
|
3 |
License: GPLv3
|
4 |
License URI: http://www.gnu.org/licenses/gpl.html
|
5 |
Tags: twitter, twitter feed, tweet, twitter widget, feed, widget, twitter sidebar, social, social media, sidebar, plugin
|
6 |
-
Requires at least: 4.
|
7 |
-
Tested up to: 4.
|
8 |
-
Stable tag: 0.
|
9 |
|
10 |
Add twitter feeds on your WordPress site by using the Easy Twitter Feed Widget plugin.
|
11 |
|
@@ -62,6 +62,10 @@ You can display tweets by using one of the following two methods.
|
|
62 |
|
63 |
== Changelog ==
|
64 |
|
|
|
|
|
|
|
|
|
65 |
= 0.6 - December 18, 2016 =
|
66 |
|
67 |
* New: Twitter embedded timeline can be displayed by using Twitter username.
|
3 |
License: GPLv3
|
4 |
License URI: http://www.gnu.org/licenses/gpl.html
|
5 |
Tags: twitter, twitter feed, tweet, twitter widget, feed, widget, twitter sidebar, social, social media, sidebar, plugin
|
6 |
+
Requires at least: 4.6
|
7 |
+
Tested up to: 4.8.1
|
8 |
+
Stable tag: 0.7
|
9 |
|
10 |
Add twitter feeds on your WordPress site by using the Easy Twitter Feed Widget plugin.
|
11 |
|
62 |
|
63 |
== Changelog ==
|
64 |
|
65 |
+
= 0.7 - September 5, 2017 =
|
66 |
+
|
67 |
+
* Enhancement: Code improvements.
|
68 |
+
|
69 |
= 0.6 - December 18, 2016 =
|
70 |
|
71 |
* New: Twitter embedded timeline can be displayed by using Twitter username.
|