Weblizar Twitter Widget - Version 1.5.6

Version Description

07/09/16 = * API version changed * New setting updated

Download this release

Release Info

Developer weblizar
Plugin Icon 128x128 Weblizar Twitter Widget
Version 1.5.6
Comparing to
See all releases

Code changes from version 1.5.5 to 1.5.6

readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: weblizar
3
  Donate link: http://www.weblizar.com/
4
  Tags: twitter, twitter follow, show latest tweets, twitter share, twitter share button, tweets, twitter widget, twitter shortcode, twitter sidebar, twitter feed, twitter plugin
5
  Requires at least: 3.5
6
- Tested up to: 4.4.2
7
- Stable tag: 1.5.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -78,6 +78,10 @@ Please use WordPress support forum to ask any query regarding any issue.
78
 
79
  For more information, see Weblizar(http://wwww.weblizar.com/).
80
 
 
 
 
 
81
  = 1.5.5 16/05/2016 =
82
  * small update
83
 
3
  Donate link: http://www.weblizar.com/
4
  Tags: twitter, twitter follow, show latest tweets, twitter share, twitter share button, tweets, twitter widget, twitter shortcode, twitter sidebar, twitter feed, twitter plugin
5
  Requires at least: 3.5
6
+ Tested up to: 4.6
7
+ Stable tag: 1.5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
78
 
79
  For more information, see Weblizar(http://wwww.weblizar.com/).
80
 
81
+ = 1.5.6 07/09/16 =
82
+ * API version changed
83
+ * New setting updated
84
+
85
  = 1.5.5 16/05/2016 =
86
  * small update
87
 
twiiter_help.php CHANGED
@@ -15,6 +15,7 @@ function SaveSettings() {
15
  var link_color = jQuery("#twitter-page-lnk-Color").val();
16
  var replieses = jQuery("#exclude_replies_23").val();
17
  var photos_acces = jQuery("#photo_1234").val();
 
18
  if(!FbAppId) {
19
  jQuery("#twitter-page-id-fetch").focus();
20
  return false;
@@ -39,6 +40,7 @@ function SaveSettings() {
39
  </script>
40
  <?php
41
  wp_enqueue_style('op-bootstrap-css', WEBLIZAR_TWITTER_PLUGIN_URL. 'css/bootstrap.min.css');
 
42
  $TwitterUserName = sanitize_text_field( $_REQUEST['twitter-page-user_name'] );
43
  $Theme = sanitize_text_field( $_REQUEST['show-theme-background'] );
44
  $Height = sanitize_text_field( $_REQUEST['twitter-page-url-Height'] );
@@ -46,8 +48,9 @@ wp_enqueue_style('op-bootstrap-css', WEBLIZAR_TWITTER_PLUGIN_URL. 'css/bootstrap
46
  $LinkColor = sanitize_text_field( $_REQUEST['twitter-page-lnk-Color'] );
47
  $ExcludeReplies = sanitize_option ( 'ExcludeReplies', $_REQUEST['exclude_replies_23'] );
48
  $AutoExpandPhotos = sanitize_option ( 'AutoExpandPhotos', $_REQUEST['photo_1234'] );
 
 
49
 
50
- if(isset($_REQUEST['twitter-page-id-fetch'])) {
51
  $TwitterSettingsArray = serialize(
52
  array(
53
  'TwitterUserName' => $TwitterUserName,
@@ -57,22 +60,23 @@ if(isset($_REQUEST['twitter-page-id-fetch'])) {
57
  'LinkColor' => $LinkColor,
58
  'ExcludeReplies' => $ExcludeReplies,
59
  'AutoExpandPhotos' => $AutoExpandPhotos,
 
60
  ));
61
  update_option("ali_twitter_shortcode", $TwitterSettingsArray);
62
  } ?>
63
  <div class="block ui-tabs-panel active" id="option-general">
64
  <div class="row">
65
  <div class="col-md-6">
66
- <h2><?php _e( 'Twitter Shortcode Settings', WEBLIZAR_TWITTER_TEXT_DOMAIN); ?>: [TWTR]</h2>
67
  <hr>
68
  <form name='fb-form' id='fb-form'>
69
  <?php
70
  $twitterSettings = unserialize(get_option("ali_twitter_shortcode"));
71
- $TwitterUserName = "";
72
  if( isset($twitterSettings[ 'TwitterUserName' ] ) ) {
73
  $TwitterUserName = $twitterSettings[ 'TwitterUserName' ];
74
  }
75
- $TwitterWidgetId = "";
76
  if ( isset($twitterSettings[ 'TwitterWidgetId' ] ) ) {
77
  $TwitterWidgetId = $twitterSettings[ 'TwitterWidgetId' ];
78
  }
@@ -100,22 +104,21 @@ if(isset($_REQUEST['twitter-page-id-fetch'])) {
100
  if ( isset( $twitterSettings[ 'AutoExpandPhotos' ] ) ) {
101
  $AutoExpandPhotos = $twitterSettings[ 'AutoExpandPhotos' ];
102
  }
 
 
 
 
103
  ?>
104
  <p>
105
- <label><?php _e( 'Twitter Account Username',WEBLIZAR_TWITTER_TEXT_DOMAIN); ?></label>
106
- <input class="widefat" id="twitter-page-user-name" name="twitter-page-user_name" type="text" value="<?php echo esc_attr($TwitterUserName); ?>" placeholder="<?php _e( 'Enter Your Twitter Account Username',WEBLIZAR_TWITTER_TEXT_DOMAIN); ?>">
107
  </p>
108
  <br>
109
-
110
  <p>
111
- <label><?php _e( 'Twitter Widget Id (Required)',WEBLIZAR_TWITTER_TEXT_DOMAIN); ?></label>
112
- <input class="widefat" id="twitter-page-id-fetch" name="twitter-page-id-fetch" type="text" value="<?php echo esc_attr( $TwitterWidgetId); ?>" placeholder="<?php _e( 'Enter Your Twitter Widget ID',WEBLIZAR_TWITTER_TEXT_DOMAIN); ?>">
113
- Get Your Twitter Widget Id: <a href="https://weblizar.com/get-twitter-widget-id/" target="_blank">HERE</a>
114
  </p>
115
- <br>
116
-
117
  <p>
118
- <label><?php _e( 'Theme',WEBLIZAR_TWITTER_TEXT_DOMAIN); ?></label>
119
  <select id="show-theme-background" name="show-theme-background">
120
  <option value="light" <?php if($Theme == "light") echo "selected=selected" ?>>Light</option>
121
  <option value="dark" <?php if($Theme == "dark") echo "selected=selected" ?>>Dark</option>
@@ -124,20 +127,20 @@ if(isset($_REQUEST['twitter-page-id-fetch'])) {
124
  <br>
125
 
126
  <p>
127
- <label><?php _e( 'Height',WEBLIZAR_TWITTER_TEXT_DOMAIN); ?></label>
128
  <input class="widefat" id="twitter-page-url-Height" name="twitter-page-url-Height" type="text" value="<?php echo esc_attr($Height ); ?>">
129
  </p>
130
  <br>
131
 
132
  <p>
133
- <label><?php _e( 'URL Link Color:',WEBLIZAR_TWITTER_TEXT_DOMAIN); ?></label>
134
  <input class="widefat" id="twitter-page-lnk-Color" name="twitter-page-lnk-Color" type="text" value="<?php echo esc_attr( $LinkColor ); ?>" >
135
  Find More Color Codes <a href="http://html-color-codes.info/" target="_blank">HERE</a>
136
  </p>
137
  <br>
138
 
139
  <p>
140
- <label><?php _e( 'Exclude Replies on Tweets',WEBLIZAR_TWITTER_TEXT_DOMAIN); ?></label>
141
  <select id="exclude_replies_23" name="exclude_replies_23">
142
  <option value="yes" <?php if($ExcludeReplies == "yes") echo "selected=selected" ?>>Yes</option>
143
  <option value="no" <?php if($ExcludeReplies == "no") echo "selected=selected" ?>>No</option>
@@ -145,7 +148,7 @@ if(isset($_REQUEST['twitter-page-id-fetch'])) {
145
  </p>
146
  <br>
147
  <p>
148
- <label><?php _e( 'Auto Expand Photos in Tweets',WEBLIZAR_TWITTER_TEXT_DOMAIN); ?></label>
149
  <select id="photo_1234" name="photo_1234">
150
  <option value="yes" <?php if($AutoExpandPhotos == "yes") echo "selected=selected" ?>>Yes</option>
151
  <option value="no" <?php if($AutoExpandPhotos == "no") echo "selected=selected" ?>>No</option>
@@ -153,13 +156,55 @@ if(isset($_REQUEST['twitter-page-id-fetch'])) {
153
  </p>
154
  <br>
155
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156
  <input onclick="return SaveSettings();" type="button" class="btn btn-primary btn-lg" id="fb-save-settings" name="fb-save-settings" value="SAVE">
157
 
158
  <div id="fb-img" style="display: none;">
159
  <img src="<?php echo WEBLIZAR_TWITTER_PLUGIN_URL.'images/loading.gif'; ?>" />
160
  </div>
161
  <div id="fb-msg" style="display: none;" class"alert">
162
- <?php _e( 'Settings successfully saved. Reloading page for generating preview right side of setting.', WEBLIZAR_TWITTER_TEXT_DOMAIN ); ?>
163
  </div>
164
  </form>
165
 
@@ -167,15 +212,15 @@ if(isset($_REQUEST['twitter-page-id-fetch'])) {
167
  <!-- Preview Part-->
168
  <div class="col-md-6">
169
  <?php if($TwitterWidgetId) { ?>
170
- <h2>Twitter Shortcode <?php _e( 'Preview', WEBLIZAR_TWITTER_TEXT_DOMAIN); ?></h2>
171
  <hr>
172
  <p>
173
- <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/<?php echo $TwitterUserName; ?>"
174
- min-width="<?php echo $Width; ?>"
175
- height="<?php echo $Height; ?>"
176
- data-theme="<?php echo $Theme; ?>"
177
- data-link-color="<?php echo $LinkColor; ?>"
178
- data-widget-id="<?php echo $TwitterWidgetId; ?>">Twitter Tweets</a>
179
  <script>
180
  !function(d,s,id) {
181
  var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}
15
  var link_color = jQuery("#twitter-page-lnk-Color").val();
16
  var replieses = jQuery("#exclude_replies_23").val();
17
  var photos_acces = jQuery("#photo_1234").val();
18
+ var tw_language = jQuery("#tw_language").val();
19
  if(!FbAppId) {
20
  jQuery("#twitter-page-id-fetch").focus();
21
  return false;
40
  </script>
41
  <?php
42
  wp_enqueue_style('op-bootstrap-css', WEBLIZAR_TWITTER_PLUGIN_URL. 'css/bootstrap.min.css');
43
+ if(isset($_REQUEST['twitter-page-user_name'])) {
44
  $TwitterUserName = sanitize_text_field( $_REQUEST['twitter-page-user_name'] );
45
  $Theme = sanitize_text_field( $_REQUEST['show-theme-background'] );
46
  $Height = sanitize_text_field( $_REQUEST['twitter-page-url-Height'] );
48
  $LinkColor = sanitize_text_field( $_REQUEST['twitter-page-lnk-Color'] );
49
  $ExcludeReplies = sanitize_option ( 'ExcludeReplies', $_REQUEST['exclude_replies_23'] );
50
  $AutoExpandPhotos = sanitize_option ( 'AutoExpandPhotos', $_REQUEST['photo_1234'] );
51
+ $tw_language = sanitize_option ( 'Language', $_REQUEST['tw_language'] );
52
+
53
 
 
54
  $TwitterSettingsArray = serialize(
55
  array(
56
  'TwitterUserName' => $TwitterUserName,
60
  'LinkColor' => $LinkColor,
61
  'ExcludeReplies' => $ExcludeReplies,
62
  'AutoExpandPhotos' => $AutoExpandPhotos,
63
+ 'tw_language' => $tw_language,
64
  ));
65
  update_option("ali_twitter_shortcode", $TwitterSettingsArray);
66
  } ?>
67
  <div class="block ui-tabs-panel active" id="option-general">
68
  <div class="row">
69
  <div class="col-md-6">
70
+ <h2><?php _e( 'Twitter Shortcode Settings', "WEBLIZAR_TWITTER_TEXT_DOMAIN"); ?>: [TWTR]</h2>
71
  <hr>
72
  <form name='fb-form' id='fb-form'>
73
  <?php
74
  $twitterSettings = unserialize(get_option("ali_twitter_shortcode"));
75
+ $TwitterUserName = "weblizar";
76
  if( isset($twitterSettings[ 'TwitterUserName' ] ) ) {
77
  $TwitterUserName = $twitterSettings[ 'TwitterUserName' ];
78
  }
79
+ $TwitterWidgetId = "123";
80
  if ( isset($twitterSettings[ 'TwitterWidgetId' ] ) ) {
81
  $TwitterWidgetId = $twitterSettings[ 'TwitterWidgetId' ];
82
  }
104
  if ( isset( $twitterSettings[ 'AutoExpandPhotos' ] ) ) {
105
  $AutoExpandPhotos = $twitterSettings[ 'AutoExpandPhotos' ];
106
  }
107
+ $tw_language = "";
108
+ if ( isset( $twitterSettings[ 'tw_language' ] ) ) {
109
+ $tw_language = $twitterSettings[ 'tw_language' ];
110
+ }
111
  ?>
112
  <p>
113
+ <label><?php _e( 'Twitter Account Username',"WEBLIZAR_TWITTER_TEXT_DOMAIN"); ?></label>
114
+ <input class="widefat" id="twitter-page-user-name" name="twitter-page-user_name" type="text" value="<?php echo esc_attr($TwitterUserName); ?>" placeholder="<?php _e( 'Enter Your Twitter Account Username',"WEBLIZAR_TWITTER_TEXT_DOMAIN"); ?>">
115
  </p>
116
  <br>
 
117
  <p>
118
+ <input class="widefat" id="twitter-page-id-fetch" name="twitter-page-id-fetch" type="hidden" value="<?php echo esc_attr( $TwitterWidgetId); ?>" placeholder="<?php _e( 'Enter Your Twitter Widget ID',"WEBLIZAR_TWITTER_TEXT_DOMAIN"); ?>">
 
 
119
  </p>
 
 
120
  <p>
121
+ <label><?php _e( 'Theme',"WEBLIZAR_TWITTER_TEXT_DOMAIN"); ?></label>
122
  <select id="show-theme-background" name="show-theme-background">
123
  <option value="light" <?php if($Theme == "light") echo "selected=selected" ?>>Light</option>
124
  <option value="dark" <?php if($Theme == "dark") echo "selected=selected" ?>>Dark</option>
127
  <br>
128
 
129
  <p>
130
+ <label><?php _e( 'Height',"WEBLIZAR_TWITTER_TEXT_DOMAIN"); ?></label>
131
  <input class="widefat" id="twitter-page-url-Height" name="twitter-page-url-Height" type="text" value="<?php echo esc_attr($Height ); ?>">
132
  </p>
133
  <br>
134
 
135
  <p>
136
+ <label><?php _e( 'URL Link Color:',"WEBLIZAR_TWITTER_TEXT_DOMAIN"); ?></label>
137
  <input class="widefat" id="twitter-page-lnk-Color" name="twitter-page-lnk-Color" type="text" value="<?php echo esc_attr( $LinkColor ); ?>" >
138
  Find More Color Codes <a href="http://html-color-codes.info/" target="_blank">HERE</a>
139
  </p>
140
  <br>
141
 
142
  <p>
143
+ <label><?php _e( 'Exclude Replies on Tweets',"WEBLIZAR_TWITTER_TEXT_DOMAIN"); ?></label>
144
  <select id="exclude_replies_23" name="exclude_replies_23">
145
  <option value="yes" <?php if($ExcludeReplies == "yes") echo "selected=selected" ?>>Yes</option>
146
  <option value="no" <?php if($ExcludeReplies == "no") echo "selected=selected" ?>>No</option>
148
  </p>
149
  <br>
150
  <p>
151
+ <label><?php _e( 'Auto Expand Photos in Tweets',"WEBLIZAR_TWITTER_TEXT_DOMAIN"); ?></label>
152
  <select id="photo_1234" name="photo_1234">
153
  <option value="yes" <?php if($AutoExpandPhotos == "yes") echo "selected=selected" ?>>Yes</option>
154
  <option value="no" <?php if($AutoExpandPhotos == "no") echo "selected=selected" ?>>No</option>
156
  </p>
157
  <br>
158
 
159
+ <p>
160
+ <label><?php _e( 'Select Language',"WEBLIZAR_TWITTER_TEXT_DOMAIN"); ?></label>
161
+ <select id="tw_language" name="tw_language">
162
+ <option value=""<?php if($tw_language == "") echo "selected=selected" ?>>Automatic</option>
163
+ <option value="en"<?php if($tw_language == "en") echo "selected=selected" ?>>English (default)</option>
164
+ <option value="ar"<?php if($tw_language == "ar") echo "selected=selected" ?>>Arabic</option>
165
+ <option value="bn"<?php if($tw_language == "bn") echo "selected=selected" ?>>Bengali</option>
166
+ <option value="cs"<?php if($tw_language == "cs") echo "selected=selected" ?>>Czech</option>
167
+ <option value="da"<?php if($tw_language == "da") echo "selected=selected" ?>>Danish</option>
168
+ <option value="de"<?php if($tw_language == "de") echo "selected=selected" ?>>German</option>
169
+ <option value="el"<?php if($tw_language == "el") echo "selected=selected" ?>>Greek</option>
170
+ <option value="es"<?php if($tw_language == "es") echo "selected=selected" ?>>Spanish</option>
171
+ <option value="fa"<?php if($tw_language == "fa") echo "selected=selected" ?>>Persian</option>
172
+ <option value="fi"<?php if($tw_language == "fi") echo "selected=selected" ?>>Finnish</option>
173
+ <option value="fil"<?php if($tw_language == "fil") echo "selected=selected" ?>>Filipino</option>
174
+ <option value="fr"<?php if($tw_language == "fr") echo "selected=selected" ?>>French</option>
175
+ <option value="he"<?php if($tw_language == "he") echo "selected=selected" ?>>Hebrew</option>
176
+ <option value="hi"<?php if($tw_language == "hi") echo "selected=selected" ?>>Hindi</option>
177
+ <option value="hu"<?php if($tw_language == "hu") echo "selected=selected" ?>>Hungarian</option>
178
+ <option value="id"<?php if($tw_language == "id") echo "selected=selected" ?>>Indonesian</option>
179
+ <option value="it"<?php if($tw_language == "it") echo "selected=selected" ?>>Italian</option>
180
+ <option value="ja"<?php if($tw_language == "ja") echo "selected=selected" ?>>Japanese</option>
181
+ <option value="ko"<?php if($tw_language == "ko") echo "selected=selected" ?>>Korean</option>
182
+ <option value="msa"<?php if($tw_language == "msa") echo "selected=selected" ?>>Malay</option>
183
+ <option value="nl"<?php if($tw_language == "nl") echo "selected=selected" ?>>Dutch</option>
184
+ <option value="no"<?php if($tw_language == "no") echo "selected=selected" ?>>Norwegian</option>
185
+ <option value="pl"<?php if($tw_language == "pl") echo "selected=selected" ?>>Polish</option>
186
+ <option value="pt"<?php if($tw_language == "pt") echo "selected=selected" ?>>Portuguese</option>
187
+ <option value="ro"<?php if($tw_language == "ro") echo "selected=selected" ?>>Romanian</option>
188
+ <option value="ru"<?php if($tw_language == "ru") echo "selected=selected" ?>>Russian</option>
189
+ <option value="sv"<?php if($tw_language == "sv") echo "selected=selected" ?>>Swedish</option>
190
+ <option value="th"<?php if($tw_language == "th") echo "selected=selected" ?>>Thai</option>
191
+ <option value="tr"<?php if($tw_language == "tr") echo "selected=selected" ?>>Turkish</option>
192
+ <option value="uk<?php if($tw_language == "uk") echo "selected=selected" ?>">Ukrainian</option>
193
+ <option value="ur"<?php if($tw_language == "ur") echo "selected=selected" ?>>Urdu</option>
194
+ <option value="vi"<?php if($tw_language == "vi") echo "selected=selected" ?>>Vietnamese</option>
195
+ <option value="zh-cn"<?php if($tw_language == "zh-cn") echo "selected=selected" ?>>Chinese (Simplified)</option>
196
+ <option value="zh-tw"<?php if($tw_language == "zh-tw") echo "selected=selected" ?>>Chinese (Traditional)</option>
197
+ </select>
198
+ </p>
199
+ <br>
200
+
201
  <input onclick="return SaveSettings();" type="button" class="btn btn-primary btn-lg" id="fb-save-settings" name="fb-save-settings" value="SAVE">
202
 
203
  <div id="fb-img" style="display: none;">
204
  <img src="<?php echo WEBLIZAR_TWITTER_PLUGIN_URL.'images/loading.gif'; ?>" />
205
  </div>
206
  <div id="fb-msg" style="display: none;" class"alert">
207
+ <?php _e( 'Settings successfully saved. Reloading page for generating preview right side of setting.', "WEBLIZAR_TWITTER_TEXT_DOMAIN" ); ?>
208
  </div>
209
  </form>
210
 
212
  <!-- Preview Part-->
213
  <div class="col-md-6">
214
  <?php if($TwitterWidgetId) { ?>
215
+ <h2>Twitter Shortcode <?php _e( 'Preview', "WEBLIZAR_TWITTER_TEXT_DOMAIN"); ?></h2>
216
  <hr>
217
  <p>
218
+ <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/<?php echo esc_attr($TwitterUserName); ?>"
219
+ min-width="<?php echo esc_attr($Width); ?>"
220
+ height="<?php echo esc_attr($Height); ?>"
221
+ data-theme="<?php echo esc_attr($Theme); ?>"
222
+ data-lang="<?php echo esc_attr($tw_language); ?>"
223
+ data-link-color="<?php echo esc_attr($LinkColor); ?>"></a>
224
  <script>
225
  !function(d,s,id) {
226
  var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}
twitter-tweets.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  * Plugin Name: Twitter Tweets
4
- * Version: 1.5.5
5
  * Description: Display your latest tweets on WordPress blog from your Twitter account.
6
  * Author: WebLizar
7
  * Author URI: http://www.weblizar.com/
@@ -42,14 +42,15 @@ class WeblizarTwitter extends WP_Widget {
42
  $ExcludeReplies = apply_filters( 'weblizar_twitter_exclude_replies', $instance['ExcludeReplies'] );
43
  $AutoExpandPhotos = apply_filters( 'weblizar_twitter_auto_expand_photo', $instance['AutoExpandPhotos'] );
44
  $TwitterWidgetId = apply_filters( 'weblizar_twitter_widget_id', $instance['TwitterWidgetId'] );
 
45
  ?>
46
  <div style="display:block;width:100%;float:left;overflow:hidden">
47
- <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/<?php echo $TwitterUserName; ?>"
48
- min-width="<?php echo $Width; ?>"
49
- height="<?php echo $Height; ?>"
50
- data-theme="<?php echo $Theme; ?>"
51
- data-link-color="<?php echo $LinkColor; ?>"
52
- data-widget-id="<?php echo $TwitterWidgetId; ?>">Twitter Tweets</a>
53
  <script>
54
  !function(d,s,id) {
55
  var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}
@@ -98,6 +99,11 @@ class WeblizarTwitter extends WP_Widget {
98
  $AutoExpandPhotos = "yes";
99
  }
100
 
 
 
 
 
 
101
  if ( isset( $instance[ 'TwitterWidgetId' ] ) ) {
102
  $TwitterWidgetId = $instance[ 'TwitterWidgetId' ];
103
  } else {
@@ -118,9 +124,8 @@ class WeblizarTwitter extends WP_Widget {
118
  <input class="widefat" id="<?php echo $this->get_field_id( 'TwitterUserName' ); ?>" name="<?php echo $this->get_field_name( 'TwitterUserName' ); ?>" type="text" value="<?php echo esc_attr( $TwitterUserName ); ?>" placeholder="<?php _e( 'Enter Your Twitter Account Username',twitter_tweets); ?>">
119
  </p>
120
  <p>
121
- <label for="<?php echo $this->get_field_id( 'TwitterWidgetId' ); ?>"><?php _e( 'Twitter Widget Id' );?> (Required)</label>
122
- <input class="widefat" id="<?php echo $this->get_field_id( 'TwitterWidgetId' ); ?>" name="<?php echo $this->get_field_name( 'TwitterWidgetId' ); ?>" type="text" value="<?php echo esc_attr( $TwitterWidgetId ); ?>" placeholder="<?php _e( 'Enter Your Twitter Widget ID',twitter_tweets); ?>">
123
- Get Your Twitter Widget Id: <a href="https://weblizar.com/get-twitter-widget-id/" target="_blank">HERE</a></p>
124
  <p>
125
  <label for="<?php echo $this->get_field_id( 'Theme' ); ?>"><?php _e( 'Theme' ); ?></label>
126
  <select id="<?php echo $this->get_field_id( 'Theme' ); ?>" name="<?php echo $this->get_field_name( 'Theme' ); ?>">
@@ -151,6 +156,49 @@ class WeblizarTwitter extends WP_Widget {
151
  <option value="no" <?php if($AutoExpandPhotos == "no") echo "selected=selected" ?>>No</option>
152
  </select>
153
  </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  <?php
155
  }
156
  /*
@@ -171,6 +219,7 @@ class WeblizarTwitter extends WP_Widget {
171
  $ExcludeReplies = sanitize_option( ( ! empty( $new_instance['ExcludeReplies'] ) ) ? strip_tags( $new_instance['ExcludeReplies'] ) : 'yes' );
172
  $AutoExpandPhotos = sanitize_option( ( ! empty( $new_instance['AutoExpandPhotos'] ) ) ? strip_tags( $new_instance['AutoExpandPhotos'] ) : 'yes' );
173
  $TwitterWidgetId = sanitize_text_field( ( ! empty( $new_instance['TwitterWidgetId'] ) ) ? strip_tags( $new_instance['TwitterWidgetId'] ) : '' );
 
174
 
175
  $instance['title'] = $title;
176
  $instance['TwitterUserName'] = $TwitterUserName;
@@ -181,6 +230,7 @@ class WeblizarTwitter extends WP_Widget {
181
  $instance['ExcludeReplies'] = $ExcludeReplies;
182
  $instance['AutoExpandPhotos'] = $AutoExpandPhotos;
183
  $instance['TwitterWidgetId'] = $TwitterWidgetId;
 
184
  return $instance;
185
  }
186
  }
1
  <?php
2
  /*
3
  * Plugin Name: Twitter Tweets
4
+ * Version: 1.5.6
5
  * Description: Display your latest tweets on WordPress blog from your Twitter account.
6
  * Author: WebLizar
7
  * Author URI: http://www.weblizar.com/
42
  $ExcludeReplies = apply_filters( 'weblizar_twitter_exclude_replies', $instance['ExcludeReplies'] );
43
  $AutoExpandPhotos = apply_filters( 'weblizar_twitter_auto_expand_photo', $instance['AutoExpandPhotos'] );
44
  $TwitterWidgetId = apply_filters( 'weblizar_twitter_widget_id', $instance['TwitterWidgetId'] );
45
+ $tw_language = apply_filters( 'weblizar_twitter_language', $instance['tw_language'] );
46
  ?>
47
  <div style="display:block;width:100%;float:left;overflow:hidden">
48
+ <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/<?php echo esc_attr($TwitterUserName); ?>"
49
+ min-width="<?php echo esc_attr($Width); ?>"
50
+ height="<?php echo esc_attr($Height); ?>"
51
+ data-theme="<?php echo esc_attr($Theme); ?>"
52
+ data-lang="<?php echo esc_attr($tw_language); ?>"
53
+ data-link-color="<?php echo esc_attr($LinkColor); ?>"></a>
54
  <script>
55
  !function(d,s,id) {
56
  var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}
99
  $AutoExpandPhotos = "yes";
100
  }
101
 
102
+ if ( isset( $instance[ 'tw_language' ] ) ) {
103
+ $tw_language = $instance[ 'tw_language' ];
104
+ } else {
105
+ $tw_language = "";
106
+ }
107
  if ( isset( $instance[ 'TwitterWidgetId' ] ) ) {
108
  $TwitterWidgetId = $instance[ 'TwitterWidgetId' ];
109
  } else {
124
  <input class="widefat" id="<?php echo $this->get_field_id( 'TwitterUserName' ); ?>" name="<?php echo $this->get_field_name( 'TwitterUserName' ); ?>" type="text" value="<?php echo esc_attr( $TwitterUserName ); ?>" placeholder="<?php _e( 'Enter Your Twitter Account Username',twitter_tweets); ?>">
125
  </p>
126
  <p>
127
+ <input class="widefat" id="<?php echo $this->get_field_id( 'TwitterWidgetId' ); ?>" name="<?php echo $this->get_field_name( 'TwitterWidgetId' ); ?>" type="hidden" value="<?php echo esc_attr( $TwitterWidgetId ); ?>" placeholder="<?php _e( 'Enter Your Twitter Widget ID',twitter_tweets); ?>">
128
+ </p>
 
129
  <p>
130
  <label for="<?php echo $this->get_field_id( 'Theme' ); ?>"><?php _e( 'Theme' ); ?></label>
131
  <select id="<?php echo $this->get_field_id( 'Theme' ); ?>" name="<?php echo $this->get_field_name( 'Theme' ); ?>">
156
  <option value="no" <?php if($AutoExpandPhotos == "no") echo "selected=selected" ?>>No</option>
157
  </select>
158
  </p>
159
+
160
+
161
+ <p>
162
+ <label for="<?php echo $this->get_field_id( 'tw_language' ); ?>"><?php _e( 'Select Language' ); ?></label>
163
+ <select id="<?php echo $this->get_field_id( 'tw_language' ); ?>" name="<?php echo $this->get_field_name('tw_language' ); ?>">
164
+ <option value=""<?php if($tw_language == "") echo "selected=selected" ?>>Automatic</option>
165
+ <option value="en"<?php if($tw_language == "en") echo "selected=selected" ?>>English (default)</option>
166
+ <option value="ar"<?php if($tw_language == "ar") echo "selected=selected" ?>>Arabic</option>
167
+ <option value="bn"<?php if($tw_language == "bn") echo "selected=selected" ?>>Bengali</option>
168
+ <option value="cs"<?php if($tw_language == "cs") echo "selected=selected" ?>>Czech</option>
169
+ <option value="da"<?php if($tw_language == "da") echo "selected=selected" ?>>Danish</option>
170
+ <option value="de"<?php if($tw_language == "de") echo "selected=selected" ?>>German</option>
171
+ <option value="el"<?php if($tw_language == "el") echo "selected=selected" ?>>Greek</option>
172
+ <option value="es"<?php if($tw_language == "es") echo "selected=selected" ?>>Spanish</option>
173
+ <option value="fa"<?php if($tw_language == "fa") echo "selected=selected" ?>>Persian</option>
174
+ <option value="fi"<?php if($tw_language == "fi") echo "selected=selected" ?>>Finnish</option>
175
+ <option value="fil"<?php if($tw_language == "fil") echo "selected=selected" ?>>Filipino</option>
176
+ <option value="fr"<?php if($tw_language == "fr") echo "selected=selected" ?>>French</option>
177
+ <option value="he"<?php if($tw_language == "he") echo "selected=selected" ?>>Hebrew</option>
178
+ <option value="hi"<?php if($tw_language == "hi") echo "selected=selected" ?>>Hindi</option>
179
+ <option value="hu"<?php if($tw_language == "hu") echo "selected=selected" ?>>Hungarian</option>
180
+ <option value="id"<?php if($tw_language == "id") echo "selected=selected" ?>>Indonesian</option>
181
+ <option value="it"<?php if($tw_language == "it") echo "selected=selected" ?>>Italian</option>
182
+ <option value="ja"<?php if($tw_language == "ja") echo "selected=selected" ?>>Japanese</option>
183
+ <option value="ko"<?php if($tw_language == "ko") echo "selected=selected" ?>>Korean</option>
184
+ <option value="msa"<?php if($tw_language == "msa") echo "selected=selected" ?>>Malay</option>
185
+ <option value="nl"<?php if($tw_language == "nl") echo "selected=selected" ?>>Dutch</option>
186
+ <option value="no"<?php if($tw_language == "no") echo "selected=selected" ?>>Norwegian</option>
187
+ <option value="pl"<?php if($tw_language == "pl") echo "selected=selected" ?>>Polish</option>
188
+ <option value="pt"<?php if($tw_language == "pt") echo "selected=selected" ?>>Portuguese</option>
189
+ <option value="ro"<?php if($tw_language == "ro") echo "selected=selected" ?>>Romanian</option>
190
+ <option value="ru"<?php if($tw_language == "ru") echo "selected=selected" ?>>Russian</option>
191
+ <option value="sv"<?php if($tw_language == "sv") echo "selected=selected" ?>>Swedish</option>
192
+ <option value="th"<?php if($tw_language == "th") echo "selected=selected" ?>>Thai</option>
193
+ <option value="tr"<?php if($tw_language == "tr") echo "selected=selected" ?>>Turkish</option>
194
+ <option value="uk<?php if($tw_language == "uk") echo "selected=selected" ?>">Ukrainian</option>
195
+ <option value="ur"<?php if($tw_language == "ur") echo "selected=selected" ?>>Urdu</option>
196
+ <option value="vi"<?php if($tw_language == "vi") echo "selected=selected" ?>>Vietnamese</option>
197
+ <option value="zh-cn"<?php if($tw_language == "zh-cn") echo "selected=selected" ?>>Chinese (Simplified)</option>
198
+ <option value="zh-tw"<?php if($tw_language == "zh-tw") echo "selected=selected" ?>>Chinese (Traditional)</option>
199
+ </select>
200
+ </p>
201
+
202
  <?php
203
  }
204
  /*
219
  $ExcludeReplies = sanitize_option( ( ! empty( $new_instance['ExcludeReplies'] ) ) ? strip_tags( $new_instance['ExcludeReplies'] ) : 'yes' );
220
  $AutoExpandPhotos = sanitize_option( ( ! empty( $new_instance['AutoExpandPhotos'] ) ) ? strip_tags( $new_instance['AutoExpandPhotos'] ) : 'yes' );
221
  $TwitterWidgetId = sanitize_text_field( ( ! empty( $new_instance['TwitterWidgetId'] ) ) ? strip_tags( $new_instance['TwitterWidgetId'] ) : '' );
222
+ $tw_language = sanitize_text_field( ( ! empty( $new_instance['tw_language'] ) ) ? strip_tags( $new_instance['tw_language'] ) : '' );
223
 
224
  $instance['title'] = $title;
225
  $instance['TwitterUserName'] = $TwitterUserName;
230
  $instance['ExcludeReplies'] = $ExcludeReplies;
231
  $instance['AutoExpandPhotos'] = $AutoExpandPhotos;
232
  $instance['TwitterWidgetId'] = $TwitterWidgetId;
233
+ $instance['tw_language'] = $tw_language;
234
  return $instance;
235
  }
236
  }
twitter-tweets_shortcode.php CHANGED
@@ -40,6 +40,10 @@ function twitter_tweet_shortcode() {
40
  if (isset( $twitterSettings[ 'AutoExpandPhotos' ] ) ) {
41
  $AutoExpandPhotos = $twitterSettings[ 'AutoExpandPhotos' ];
42
  }
 
 
 
 
43
 
44
  if (isset($twitterSettings[ 'TwitterWidgetId' ] ) ) {
45
  $TwitterWidgetId = $twitterSettings[ 'TwitterWidgetId' ];
@@ -53,12 +57,12 @@ function twitter_tweet_shortcode() {
53
  }
54
  ?>
55
  <div style="display:block;width:100%;float:left;overflow:hidden">
56
- <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/<?php echo esc_attr($TwitterUserName); ?>"
57
  min-width="<?php echo esc_attr($Width); ?>"
58
  height="<?php echo esc_attr($Height); ?>"
59
  data-theme="<?php echo esc_attr($Theme); ?>"
60
- data-link-color="<?php echo esc_attr($LinkColor); ?>"
61
- data-widget-id="<?php echo esc_attr($TwitterWidgetId); ?>">Twitter Tweets</a>
62
  <script>
63
  !function(d,s,id) {
64
  var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}
40
  if (isset( $twitterSettings[ 'AutoExpandPhotos' ] ) ) {
41
  $AutoExpandPhotos = $twitterSettings[ 'AutoExpandPhotos' ];
42
  }
43
+ $tw_language = "";
44
+ if (isset( $twitterSettings[ 'tw_language' ] ) ) {
45
+ $tw_language = $twitterSettings[ 'tw_language' ];
46
+ }
47
 
48
  if (isset($twitterSettings[ 'TwitterWidgetId' ] ) ) {
49
  $TwitterWidgetId = $twitterSettings[ 'TwitterWidgetId' ];
57
  }
58
  ?>
59
  <div style="display:block;width:100%;float:left;overflow:hidden">
60
+ <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/<?php echo esc_attr($TwitterUserName); ?>"
61
  min-width="<?php echo esc_attr($Width); ?>"
62
  height="<?php echo esc_attr($Height); ?>"
63
  data-theme="<?php echo esc_attr($Theme); ?>"
64
+ data-lang="<?php echo esc_attr($tw_language); ?>"
65
+ data-link-color="<?php echo esc_attr($LinkColor); ?>"></a>
66
  <script>
67
  !function(d,s,id) {
68
  var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}