Version Description
December 18, 2015 =
Enhancement: WP_Widget is deprecated and replaced with __construct().
Download this release
Release Info
Developer | designorbital |
Plugin | Easy Twitter Feed Widget Plugin |
Version | 0.5 |
Comparing to | |
See all releases |
Code changes from version 0.4 to 0.5
- easy-twitter-feed-widget.php +1 -1
- lib/widget-easy-twitter-feed-widget.php +302 -309
- readme.txt +8 -4
easy-twitter-feed-widget.php
CHANGED
@@ -7,7 +7,7 @@ Author: DesignOrbital.com
|
|
7 |
Author URI: http://designorbital.com
|
8 |
Text Domain: kamn-easy-twitter-feed-widget
|
9 |
Domain Path: /languages/
|
10 |
-
Version: 0.
|
11 |
License: GPL v3
|
12 |
|
13 |
Easy Twitter Feed Widget Plugin
|
7 |
Author URI: http://designorbital.com
|
8 |
Text Domain: kamn-easy-twitter-feed-widget
|
9 |
Domain Path: /languages/
|
10 |
+
Version: 0.5
|
11 |
License: GPL v3
|
12 |
|
13 |
Easy Twitter Feed Widget Plugin
|
lib/widget-easy-twitter-feed-widget.php
CHANGED
@@ -1,310 +1,303 @@
|
|
1 |
-
<?php
|
2 |
-
/**********************************************
|
3 |
-
* Twitterwidget Widget
|
4 |
-
* https://dev.twitter.com/web/embedded-timelines
|
5 |
-
**********************************************/
|
6 |
-
|
7 |
-
class Kamn_Widget_Easytwitterfeedwidget extends WP_Widget {
|
8 |
-
|
9 |
-
/**
|
10 |
-
* Set up the widget's unique name, ID, class, description, and other options.
|
11 |
-
*/
|
12 |
-
function __construct() {
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
'
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
$
|
48 |
-
|
49 |
-
|
50 |
-
$
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
$
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
'data-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
?>
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
*
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
$
|
149 |
-
|
150 |
-
|
151 |
-
$
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
<
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
<
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
'
|
290 |
-
'
|
291 |
-
'
|
292 |
-
'
|
293 |
-
'
|
294 |
-
'
|
295 |
-
'
|
296 |
-
'
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
'twitter_widget_chrome_background' => 1
|
304 |
-
);
|
305 |
-
|
306 |
-
return $defaults;
|
307 |
-
|
308 |
-
}
|
309 |
-
|
310 |
}
|
1 |
+
<?php
|
2 |
+
/**********************************************
|
3 |
+
* Twitterwidget Widget
|
4 |
+
* https://dev.twitter.com/web/embedded-timelines
|
5 |
+
**********************************************/
|
6 |
+
|
7 |
+
class Kamn_Widget_Easytwitterfeedwidget extends WP_Widget {
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Set up the widget's unique name, ID, class, description, and other options.
|
11 |
+
*/
|
12 |
+
function __construct() {
|
13 |
+
|
14 |
+
parent::__construct(
|
15 |
+
'widget-easy-twitter-feed-widget-kamn',
|
16 |
+
apply_filters( 'kamn_easy_twitter_feed_widget_name', __( 'Easy Twitter Feed Widget', 'kamn-easy-twitter-feed-widget') ),
|
17 |
+
array(
|
18 |
+
'classname' => 'widget-easy-twitter-feed-widget-kamn',
|
19 |
+
'description' => __( 'A widget to display Twitter feed.', 'kamn-easy-twitter-feed-widget' )
|
20 |
+
)
|
21 |
+
);
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Outputs the widget based on the arguments input through the widget controls.
|
26 |
+
*
|
27 |
+
* @param array $args Display arguments including before_title, after_title, before_widget, and after_widget.
|
28 |
+
* @param array $instance The settings for the particular instance of the widget
|
29 |
+
*/
|
30 |
+
|
31 |
+
function widget( $args, $instance ) {
|
32 |
+
|
33 |
+
/** Global Data */
|
34 |
+
global $post;
|
35 |
+
|
36 |
+
/** Extract Args */
|
37 |
+
extract( $args );
|
38 |
+
|
39 |
+
/** Set up the default form values. */
|
40 |
+
$defaults = $this->kamn_defaults();
|
41 |
+
|
42 |
+
/** Merge the user-selected arguments with the defaults. */
|
43 |
+
$instance = wp_parse_args( (array) $instance, $defaults );
|
44 |
+
|
45 |
+
/** Data Chrome */
|
46 |
+
$data_chrome = array();
|
47 |
+
$data_chrome[] = ( $instance['twitter_widget_chrome_header'] == 0 )? 'noheader': '';
|
48 |
+
$data_chrome[] = ( $instance['twitter_widget_chrome_footer'] == 0 )? 'nofooter': '';
|
49 |
+
$data_chrome[] = ( $instance['twitter_widget_chrome_border'] == 0 )? 'noborders': '';
|
50 |
+
$data_chrome[] = ( $instance['twitter_widget_chrome_scrollbar'] == 0 )? 'noscrollbar': '';
|
51 |
+
$data_chrome[] = ( $instance['twitter_widget_chrome_background'] == 0 )? 'transparent': '';
|
52 |
+
|
53 |
+
/** Data Attributes */
|
54 |
+
$data_twitter_widget = array(
|
55 |
+
'data-widget-id' => $instance['twitter_widget_id'],
|
56 |
+
'data-screen-name' => $instance['twitter_widget_screen_name'],
|
57 |
+
'data-show-replies' => $instance['twitter_widget_show_replies'],
|
58 |
+
'data-theme' => $instance['twitter_widget_theme'],
|
59 |
+
'data-link-color' => $instance['twitter_widget_link_color'],
|
60 |
+
'data-border-color' => $instance['twitter_widget_border_color'],
|
61 |
+
'data-chrome' => trim( join( ' ', $data_chrome ) )
|
62 |
+
);
|
63 |
+
|
64 |
+
/** Twitter only manages scrollbar / height at default value. So this is for it :) */
|
65 |
+
if( $instance['twitter_widget_tweet_limit'] != 0 ) {
|
66 |
+
$data_twitter_widget['data-tweet-limit'] = $instance['twitter_widget_tweet_limit'];
|
67 |
+
}
|
68 |
+
|
69 |
+
/** Data Attributes as name=value */
|
70 |
+
$data_twitter_widget_nv = '';
|
71 |
+
foreach ( $data_twitter_widget as $key => $val ) {
|
72 |
+
$data_twitter_widget_nv .= $key . '=' . '"' . esc_attr( $val ) . '"' . ' ';
|
73 |
+
}
|
74 |
+
|
75 |
+
/** Open the output of the widget. */
|
76 |
+
echo $before_widget;
|
77 |
+
|
78 |
+
?>
|
79 |
+
<div class="widget-easy-twitter-feed-widget-global-wrapper">
|
80 |
+
<div class="widget-easy-twitter-feed-widget-container">
|
81 |
+
|
82 |
+
<?php if ( ! empty( $instance['title'] ) ) : ?>
|
83 |
+
<div class="row">
|
84 |
+
<div class="col-lg-12">
|
85 |
+
<?php echo $before_title . '<span>' . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . '</span>' . $after_title; ?>
|
86 |
+
</div>
|
87 |
+
</div>
|
88 |
+
<?php endif; ?>
|
89 |
+
|
90 |
+
<div class="widget-easy-twitter-feed-widget-row">
|
91 |
+
<div class="widget-easy-twitter-feed-widget-col">
|
92 |
+
<div class="twitterwidget <?php echo $widget_id; ?>">
|
93 |
+
<a class="twitter-timeline" width="<?php echo $instance['twitter_widget_width']; ?>" height="<?php echo $instance['twitter_widget_height']; ?>" href="https://twitter.com/twitterdev" <?php echo trim( $data_twitter_widget_nv ); ?>><?php _e( 'Tweets by @', 'kamn-easy-twitter-feed-widget' ); ?><?php echo $instance['twitter_widget_screen_name']; ?></a>
|
94 |
+
</div>
|
95 |
+
</div>
|
96 |
+
</div>
|
97 |
+
|
98 |
+
</div> <!-- End .widget-global-wrapper -->
|
99 |
+
</div>
|
100 |
+
|
101 |
+
<?php
|
102 |
+
|
103 |
+
/** Close the output of the widget. */
|
104 |
+
echo $after_widget;
|
105 |
+
|
106 |
+
}
|
107 |
+
|
108 |
+
/** Updates the widget control options for the particular instance of the widget.
|
109 |
+
*
|
110 |
+
* This function should check that $new_instance is set correctly.
|
111 |
+
* The newly calculated value of $instance should be returned.
|
112 |
+
* If "false" is returned, the instance won't be saved/updated.
|
113 |
+
*
|
114 |
+
* @param array $new_instance New settings for this instance as input by the user via form()
|
115 |
+
* @param array $old_instance Old settings for this instance
|
116 |
+
* @return array Settings to save or bool false to cancel saving
|
117 |
+
*/
|
118 |
+
function update( $new_instance, $old_instance ) {
|
119 |
+
|
120 |
+
/** Default Args */
|
121 |
+
$defaults = $this->kamn_defaults();
|
122 |
+
|
123 |
+
/** Update Logic */
|
124 |
+
$instance = $old_instance;
|
125 |
+
foreach( $defaults as $key => $val ) {
|
126 |
+
$instance[$key] = strip_tags( $new_instance[$key] );
|
127 |
+
}
|
128 |
+
return $instance;
|
129 |
+
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
*
|
134 |
+
* Displays the widget control options in the Widgets admin screen.
|
135 |
+
*
|
136 |
+
* @param array $instance Current settings
|
137 |
+
*/
|
138 |
+
function form( $instance ) {
|
139 |
+
|
140 |
+
/** Set up the default form values. */
|
141 |
+
$defaults = $this->kamn_defaults();
|
142 |
+
|
143 |
+
/** Merge the user-selected arguments with the defaults. */
|
144 |
+
$instance = wp_parse_args( (array) $instance, $defaults );
|
145 |
+
|
146 |
+
$title = strip_tags( $instance['title'] );
|
147 |
+
$twitter_widget_tweet_limit = array_merge( array( 0 => 'default' ), array_combine( range( 1, 20 ), range( 1, 20 ) ) );
|
148 |
+
$twitter_widget_show_replies = array( 'true' => 'Yes', 'false' => 'No' );
|
149 |
+
$twitter_widget_width = range( 180, 520, 20 );
|
150 |
+
$twitter_widget_height = range( 200, 600, 50 );
|
151 |
+
$twitter_widget_theme = array( 'light' => 'Light', 'dark' => 'Dark' );
|
152 |
+
$boolean = array( 1 => 'Yes', 0 => 'No' );
|
153 |
+
?>
|
154 |
+
|
155 |
+
<p>
|
156 |
+
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'kamn-easy-twitter-feed-widget' ); ?></label>
|
157 |
+
<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" />
|
158 |
+
</p>
|
159 |
+
|
160 |
+
<p><strong><?php _e( 'Easy Twitter Feed Widget Settings', 'kamn-easy-twitter-feed-widget' ); ?></strong></p>
|
161 |
+
<hr />
|
162 |
+
|
163 |
+
<p>
|
164 |
+
<label for="<?php echo $this->get_field_id( 'twitter_widget_id' ); ?>"><?php _e( 'Twitter Widget ID:', 'kamn-easy-twitter-feed-widget' ); ?></label>
|
165 |
+
<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'twitter_widget_id' ); ?>" name="<?php echo $this->get_field_name( 'twitter_widget_id' ); ?>" value="<?php echo esc_attr( $instance['twitter_widget_id'] ); ?>" />
|
166 |
+
</p>
|
167 |
+
|
168 |
+
<p>
|
169 |
+
<label for="<?php echo $this->get_field_id( 'twitter_widget_screen_name' ); ?>"><?php _e( 'Twitter Screen Name:', 'kamn-easy-twitter-feed-widget' ); ?></label>
|
170 |
+
<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'twitter_widget_screen_name' ); ?>" name="<?php echo $this->get_field_name( 'twitter_widget_screen_name' ); ?>" value="<?php echo esc_attr( $instance['twitter_widget_screen_name'] ); ?>" />
|
171 |
+
</p>
|
172 |
+
|
173 |
+
<p>
|
174 |
+
<label for="<?php echo $this->get_field_id( 'twitter_widget_tweet_limit' ); ?>"><?php _e( 'Tweet Limit:', 'kamn-easy-twitter-feed-widget' ); ?></label>
|
175 |
+
<select class="widefat" id="<?php echo $this->get_field_id( 'twitter_widget_tweet_limit' ); ?>" name="<?php echo $this->get_field_name( 'twitter_widget_tweet_limit' ); ?>">
|
176 |
+
<?php foreach ( $twitter_widget_tweet_limit as $key => $val ): ?>
|
177 |
+
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $instance['twitter_widget_tweet_limit'], $key ); ?>><?php echo esc_html( $val ); ?></option>
|
178 |
+
<?php endforeach; ?>
|
179 |
+
</select>
|
180 |
+
</p>
|
181 |
+
|
182 |
+
<p>
|
183 |
+
<label for="<?php echo $this->get_field_id( 'twitter_widget_show_replies' ); ?>"><?php _e( 'Show Replies:', 'kamn-easy-twitter-feed-widget' ); ?></label>
|
184 |
+
<select class="widefat" id="<?php echo $this->get_field_id( 'twitter_widget_show_replies' ); ?>" name="<?php echo $this->get_field_name( 'twitter_widget_show_replies' ); ?>">
|
185 |
+
<?php foreach ( $twitter_widget_show_replies as $key => $val ): ?>
|
186 |
+
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $instance['twitter_widget_show_replies'], $key ); ?>><?php echo esc_html( $val ); ?></option>
|
187 |
+
<?php endforeach; ?>
|
188 |
+
</select>
|
189 |
+
</p>
|
190 |
+
|
191 |
+
<p>
|
192 |
+
<label for="<?php echo $this->get_field_id( 'twitter_widget_width' ); ?>"><?php _e( 'Twitter Widget Width:', 'kamn-easy-twitter-feed-widget' ); ?></label>
|
193 |
+
<select class="widefat" id="<?php echo $this->get_field_id( 'twitter_widget_width' ); ?>" name="<?php echo $this->get_field_name( 'twitter_widget_width' ); ?>">
|
194 |
+
<?php foreach ( $twitter_widget_width as $val ): ?>
|
195 |
+
<option value="<?php echo esc_attr( $val ); ?>" <?php selected( $instance['twitter_widget_width'], $val ); ?>><?php echo esc_html( $val ); ?></option>
|
196 |
+
<?php endforeach; ?>
|
197 |
+
</select>
|
198 |
+
</p>
|
199 |
+
|
200 |
+
<p>
|
201 |
+
<label for="<?php echo $this->get_field_id( 'twitter_widget_height' ); ?>"><?php _e( 'Twitter Widget Height:', 'kamn-easy-twitter-feed-widget' ); ?></label>
|
202 |
+
<select class="widefat" id="<?php echo $this->get_field_id( 'twitter_widget_height' ); ?>" name="<?php echo $this->get_field_name( 'twitter_widget_height' ); ?>">
|
203 |
+
<?php foreach ( $twitter_widget_height as $val ): ?>
|
204 |
+
<option value="<?php echo esc_attr( $val ); ?>" <?php selected( $instance['twitter_widget_height'], $val ); ?>><?php echo esc_html( $val ); ?></option>
|
205 |
+
<?php endforeach; ?>
|
206 |
+
</select>
|
207 |
+
<small><?php _e( 'Height setting will work only @ Tweet Limit "default".', 'kamn-easy-twitter-feed-widget' ); ?></small>
|
208 |
+
</p>
|
209 |
+
|
210 |
+
<p>
|
211 |
+
<label for="<?php echo $this->get_field_id( 'twitter_widget_theme' ); ?>"><?php _e( 'Twitter Widget Theme:', 'kamn-easy-twitter-feed-widget' ); ?></label>
|
212 |
+
<select class="widefat" id="<?php echo $this->get_field_id( 'twitter_widget_theme' ); ?>" name="<?php echo $this->get_field_name( 'twitter_widget_theme' ); ?>">
|
213 |
+
<?php foreach ( $twitter_widget_theme as $key => $val ): ?>
|
214 |
+
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $instance['twitter_widget_theme'], $key ); ?>><?php echo esc_html( $val ); ?></option>
|
215 |
+
<?php endforeach; ?>
|
216 |
+
</select>
|
217 |
+
</p>
|
218 |
+
|
219 |
+
<p>
|
220 |
+
<label for="<?php echo $this->get_field_id( 'twitter_widget_link_color' ); ?>"><?php _e( 'Twitter Widget Link Color:', 'kamn-easy-twitter-feed-widget' ); ?> <small><?php _e( 'e.g #333333', 'kamn-easy-twitter-feed-widget' ); ?></small></label><br />
|
221 |
+
<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'twitter_widget_link_color' ); ?>" name="<?php echo $this->get_field_name( 'twitter_widget_link_color' ); ?>" value="<?php echo esc_attr( $instance['twitter_widget_link_color'] ); ?>" />
|
222 |
+
</p>
|
223 |
+
|
224 |
+
<p>
|
225 |
+
<label for="<?php echo $this->get_field_id( 'twitter_widget_chrome_header' ); ?>"><?php _e( 'Show Twitter Widget Header:', 'kamn-easy-twitter-feed-widget' ); ?></label>
|
226 |
+
<select class="widefat" id="<?php echo $this->get_field_id( 'twitter_widget_chrome_header' ); ?>" name="<?php echo $this->get_field_name( 'twitter_widget_chrome_header' ); ?>">
|
227 |
+
<?php foreach ( $boolean as $key => $val ): ?>
|
228 |
+
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $instance['twitter_widget_chrome_header'], $key ); ?>><?php echo esc_html( $val ); ?></option>
|
229 |
+
<?php endforeach; ?>
|
230 |
+
</select>
|
231 |
+
</p>
|
232 |
+
|
233 |
+
<p>
|
234 |
+
<label for="<?php echo $this->get_field_id( 'twitter_widget_chrome_footer' ); ?>"><?php _e( 'Show Twitter Widget Footer:', 'kamn-easy-twitter-feed-widget' ); ?></label>
|
235 |
+
<select class="widefat" id="<?php echo $this->get_field_id( 'twitter_widget_chrome_footer' ); ?>" name="<?php echo $this->get_field_name( 'twitter_widget_chrome_footer' ); ?>">
|
236 |
+
<?php foreach ( $boolean as $key => $val ): ?>
|
237 |
+
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $instance['twitter_widget_chrome_footer'], $key ); ?>><?php echo esc_html( $val ); ?></option>
|
238 |
+
<?php endforeach; ?>
|
239 |
+
</select>
|
240 |
+
</p>
|
241 |
+
|
242 |
+
<p>
|
243 |
+
<label for="<?php echo $this->get_field_id( 'twitter_widget_chrome_border' ); ?>"><?php _e( 'Show Twitter Widget Border:', 'kamn-easy-twitter-feed-widget' ); ?></label>
|
244 |
+
<select class="widefat" id="<?php echo $this->get_field_id( 'twitter_widget_chrome_border' ); ?>" name="<?php echo $this->get_field_name( 'twitter_widget_chrome_border' ); ?>">
|
245 |
+
<?php foreach ( $boolean as $key => $val ): ?>
|
246 |
+
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $instance['twitter_widget_chrome_border'], $key ); ?>><?php echo esc_html( $val ); ?></option>
|
247 |
+
<?php endforeach; ?>
|
248 |
+
</select>
|
249 |
+
</p>
|
250 |
+
|
251 |
+
<p>
|
252 |
+
<label for="<?php echo $this->get_field_id( 'twitter_widget_border_color' ); ?>"><?php _e( 'Twitter Widget Border Color:', 'kamn-easy-twitter-feed-widget' ); ?> <small><?php _e( 'e.g #333333', 'kamn-easy-twitter-feed-widget' ); ?></small></label><br />
|
253 |
+
<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'twitter_widget_border_color' ); ?>" name="<?php echo $this->get_field_name( 'twitter_widget_border_color' ); ?>" value="<?php echo esc_attr( $instance['twitter_widget_border_color'] ); ?>" />
|
254 |
+
</p>
|
255 |
+
|
256 |
+
<p>
|
257 |
+
<label for="<?php echo $this->get_field_id( 'twitter_widget_chrome_scrollbar' ); ?>"><?php _e( 'Show Twitter Widget Scrollbar:', 'kamn-easy-twitter-feed-widget' ); ?></label>
|
258 |
+
<select class="widefat" id="<?php echo $this->get_field_id( 'twitter_widget_chrome_scrollbar' ); ?>" name="<?php echo $this->get_field_name( 'twitter_widget_chrome_scrollbar' ); ?>">
|
259 |
+
<?php foreach ( $boolean as $key => $val ): ?>
|
260 |
+
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $instance['twitter_widget_chrome_scrollbar'], $key ); ?>><?php echo esc_html( $val ); ?></option>
|
261 |
+
<?php endforeach; ?>
|
262 |
+
</select>
|
263 |
+
<small><?php _e( 'Scrollbar setting will work only @ Tweet Limit "default".', 'kamn-easy-twitter-feed-widget' ); ?></small>
|
264 |
+
</p>
|
265 |
+
|
266 |
+
<p>
|
267 |
+
<label for="<?php echo $this->get_field_id( 'twitter_widget_chrome_background' ); ?>"><?php _e( 'Use Twitter Widget Background Color:', 'kamn-easy-twitter-feed-widget' ); ?></label>
|
268 |
+
<select class="widefat" id="<?php echo $this->get_field_id( 'twitter_widget_chrome_background' ); ?>" name="<?php echo $this->get_field_name( 'twitter_widget_chrome_background' ); ?>">
|
269 |
+
<?php foreach ( $boolean as $key => $val ): ?>
|
270 |
+
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $instance['twitter_widget_chrome_background'], $key ); ?>><?php echo esc_html( $val ); ?></option>
|
271 |
+
<?php endforeach; ?>
|
272 |
+
</select>
|
273 |
+
</p>
|
274 |
+
|
275 |
+
<?php
|
276 |
+
}
|
277 |
+
|
278 |
+
/** Set up the default form values. */
|
279 |
+
function kamn_defaults() {
|
280 |
+
|
281 |
+
$defaults = array(
|
282 |
+
'title' => esc_attr__( 'Twitter Widget', 'kamn-easy-twitter-feed-widget'),
|
283 |
+
'twitter_widget_id' => '344713329262084096',
|
284 |
+
'twitter_widget_screen_name' => 'designorbital',
|
285 |
+
'twitter_widget_tweet_limit' => 0,
|
286 |
+
'twitter_widget_show_replies' => 'false',
|
287 |
+
'twitter_widget_width' => 300,
|
288 |
+
'twitter_widget_height' => 250,
|
289 |
+
'twitter_widget_theme' => 'light',
|
290 |
+
'twitter_widget_link_color' => '',
|
291 |
+
'twitter_widget_border_color' => '',
|
292 |
+
'twitter_widget_chrome_header' => 1,
|
293 |
+
'twitter_widget_chrome_footer' => 1,
|
294 |
+
'twitter_widget_chrome_border' => 1,
|
295 |
+
'twitter_widget_chrome_scrollbar' => 1,
|
296 |
+
'twitter_widget_chrome_background' => 1
|
297 |
+
);
|
298 |
+
|
299 |
+
return $defaults;
|
300 |
+
|
301 |
+
}
|
302 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
303 |
}
|
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 |
|
@@ -21,7 +21,7 @@ If you are planning to display tweets on your blog's sidebar without bells and w
|
|
21 |
* Make it your own by customizing the link color, border color, background choice and other useful options.
|
22 |
|
23 |
= Further Useful Stuff =
|
24 |
-
Easy Twitter Feed Widget plugin is developed by DesignOrbital. You may be interesed to use our [Premium WordPress Themes](
|
25 |
|
26 |
== Installation ==
|
27 |
|
@@ -47,6 +47,10 @@ Easy Twitter Feed Widget plugin is developed by DesignOrbital. You may be intere
|
|
47 |
|
48 |
== Changelog ==
|
49 |
|
|
|
|
|
|
|
|
|
50 |
= 0.4 - July 27, 2015 =
|
51 |
|
52 |
* Enhancement: No widget title HTML markup will print when the widget title is empty.
|
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.5
|
7 |
+
Tested up to: 4.7
|
8 |
+
Stable tag: 0.5
|
9 |
|
10 |
Add twitter feeds on your WordPress site by using the Easy Twitter Feed Widget plugin.
|
11 |
|
21 |
* Make it your own by customizing the link color, border color, background choice and other useful options.
|
22 |
|
23 |
= Further Useful Stuff =
|
24 |
+
Easy Twitter Feed Widget plugin is developed by DesignOrbital. You may be interesed to use our [Premium WordPress Themes](https://designorbital.com/) or [Free WordPress Themes](https://designorbital.com/free-wordpress-themes/) to run your website under the clean and SEO optimized code.
|
25 |
|
26 |
== Installation ==
|
27 |
|
47 |
|
48 |
== Changelog ==
|
49 |
|
50 |
+
= 0.5 - December 18, 2015 =
|
51 |
+
|
52 |
+
* Enhancement: WP_Widget is deprecated and replaced with __construct().
|
53 |
+
|
54 |
= 0.4 - July 27, 2015 =
|
55 |
|
56 |
* Enhancement: No widget title HTML markup will print when the widget title is empty.
|