Weblizar Twitter Widget - Version 0.8

Version Description

  • Added Widget Title
Download this release

Release Info

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

Code changes from version 0.1 to 0.8

Files changed (3) hide show
  1. Thumbs.db +0 -0
  2. readme.txt +25 -4
  3. twitter-tweets.php +36 -36
Thumbs.db CHANGED
Binary file
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === Twitter Tweets ===
2
  Contributors: weblizar
3
  Donate link: http://www.weblizar.com/
4
- Tags: twitter, twitter plugin, button, connect, follow button, tvet, tvett, tvit, tviter, tvitt, tweet, tweeter, twett, twit, twiter, twitter connect, tweet, twitter connect, twitter follow, twitter follow button, twitter share, twitter share button, social, stream, tweets, twitter widget, latest tweets, add tweet, twitter shortcode, reply, follow me, like, follow
5
  Requires at least: 3.0
6
- Tested up to: 3.9.1
7
- Stable tag: 0.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -77,6 +77,27 @@ Please use WordPress support forum to ask any query regarding any issue.
77
 
78
  For more information, see Weblizar(http://wwww.weblizar.com/).
79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  = 0.1 =
81
 
82
  * Widget Customization Settings
1
+ === Tweets ===
2
  Contributors: weblizar
3
  Donate link: http://www.weblizar.com/
4
+ Tags: twitter, twitter plugin, button, connect, follow button, tvet, tvett, tvit, tviter, tvitt, tweet, tweeter, twett, twit, twiter, twitter connect, tweet, twitter connect, twitter follow, twitter follow button, twitter share, twitter share button, social, button, social button, stream, tweets, twitter widget, latest tweets, add tweet, twitter shortcode, twitter button, reply, follow me, like, follow, twitter news, tweets, bitly, links, microblogging, Post, redirect, shortener, twitter, yourls, widget, plugin, wordpress twitter, twitter bootstrap, archive, integrate, integration, notify, shortcode, twitter search, twitter share, twitter share button, twitter shortcode, twitter sidebar, twitter timeline, twitter tools, twitter widget, twitter-followers, WordPress Twitter , twitter api, twitter badge, twitter button, twitter cards, twitter connect, twitter favorites, social bookmark, social bookmarking, add link to twitter, post to twitter, publish post to twitter, social media,
5
  Requires at least: 3.0
6
+ Tested up to: 4.1
7
+ Stable tag: 0.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
77
 
78
  For more information, see Weblizar(http://wwww.weblizar.com/).
79
 
80
+ = 0.8 =
81
+ * Added Widget Title
82
+
83
+ = 0.7 =
84
+ * Compatible With WordPress 4.1
85
+
86
+ = 0.5 =
87
+ * Compatible With WordPress 4.0.1
88
+ * Small changes in file
89
+
90
+ = 0.4 =
91
+ * Compatible With WordPress 4.0
92
+
93
+ = 0.3 =
94
+ * Remove design issue
95
+ * Small changes in readme
96
+
97
+ = 0.2 =
98
+
99
+ * resolved css error.
100
+
101
  = 0.1 =
102
 
103
  * Widget Customization Settings
twitter-tweets.php CHANGED
@@ -1,25 +1,12 @@
1
  <?php
2
  /**
3
  * Plugin Name: Twitter Tweets
4
- * Version: 0.1
5
  * Description: Display latest tweets on WordPress blog from Twitter account.
6
  * Author: WebLizar
7
  * Author URI: http://www.weblizar.com
8
  * Plugin URI: http://www.weblizar.com/plugins/
9
  *
10
- * This program is free software; you can redistribute it and/or
11
- * modify it under the terms of the GNU General Public License
12
- * as published by the Free Software Foundation; either version 2
13
- * of the License, or (at your option) any later version.
14
- *
15
- * This program is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- * GNU General Public License for more details.
19
- *
20
- * You should have received a copy of the GNU General Public License
21
- * along with this program; if not, write to the Free Software
22
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23
  */
24
 
25
  /**
@@ -57,6 +44,17 @@ class WeblizarTwitter extends WP_Widget {
57
  * @param array $instance Saved values from database.
58
  */
59
  public function widget( $args, $instance ) {
 
 
 
 
 
 
 
 
 
 
 
60
  $TwitterUserName = apply_filters( 'weblizar_twitter_user_name', $instance['TwitterUserName'] );
61
  $Theme = apply_filters( 'weblizar_twitter_theme', $instance['Theme'] );
62
  $Height = apply_filters( 'weblizar_twitter_height', $instance['Height'] );
@@ -66,27 +64,17 @@ class WeblizarTwitter extends WP_Widget {
66
  $AutoExpandPhotos = apply_filters( 'weblizar_twitter_auto_expand_photo', $instance['AutoExpandPhotos'] );
67
  $TwitterWidgetId = apply_filters( 'weblizar_twitter_widget_id', $instance['TwitterWidgetId'] );
68
  ?>
69
- <!--generated code-->
70
- <!--<a class="twitter-timeline" href="https://twitter.com/weblizar" data-widget-id="462084801944485888">Tweets by @weblizar</a>
71
- <script>!function(d,s,id){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);}}(document,"script","twitter-wjs");</script>-->
72
-
73
- <!--default development code-->
74
- <!--<a class="twitter-timeline"
75
- href="https://twitter.com/weblizar"
76
- data-screen-name="weblizar"
77
- data-widget-id="462084801944485888"
78
- data-related="twitterapi,twitter"
79
- data-aria-polite="assertive"
80
- data-tweet-limit="5"
81
- lang="EN">Tweets by @weblizar</a>-->
82
-
83
- <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/<?php echo $TwitterUserName; ?>" min-width="<?php echo $Width; ?>" height="<?php echo $Height; ?>" data-theme="<?php echo $Theme; ?>" data-link-color="<?php echo $LinkColor; ?>px" data-widget-id="<?php echo $TwitterWidgetId; ?>">Twitter Tweets</a>
84
- <script>
85
- !function(d,s,id) {
86
- 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);}
87
- } (document,"script","twitter-wjs");
88
- </script>
89
  <?php
 
90
  }
91
 
92
  /**
@@ -143,8 +131,19 @@ class WeblizarTwitter extends WP_Widget {
143
  } else {
144
  $TwitterWidgetId = "462084801944485888";
145
  }
146
- ?>
147
-
 
 
 
 
 
 
 
 
 
 
 
148
  <p>
149
  <label for="<?php echo $this->get_field_id( 'TwitterUserName' ); ?>"><?php _e( 'Twitter Username' ); ?></label>
150
  <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 ); ?>">
@@ -211,6 +210,7 @@ class WeblizarTwitter extends WP_Widget {
211
  */
212
  public function update( $new_instance, $old_instance ) {
213
  $instance = array();
 
214
  $instance['TwitterUserName'] = ( ! empty( $new_instance['TwitterUserName'] ) ) ? strip_tags( $new_instance['TwitterUserName'] ) : 'weblizar';
215
  $instance['Theme'] = ( ! empty( $new_instance['Theme'] ) ) ? strip_tags( $new_instance['Theme'] ) : 'light';
216
  $instance['Height'] = ( ! empty( $new_instance['Height'] ) ) ? strip_tags( $new_instance['Height'] ) : '450';
1
  <?php
2
  /**
3
  * Plugin Name: Twitter Tweets
4
+ * Version: 0.8
5
  * Description: Display latest tweets on WordPress blog from Twitter account.
6
  * Author: WebLizar
7
  * Author URI: http://www.weblizar.com
8
  * Plugin URI: http://www.weblizar.com/plugins/
9
  *
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  */
11
 
12
  /**
44
  * @param array $instance Saved values from database.
45
  */
46
  public function widget( $args, $instance ) {
47
+ // Outputs the content of the widget
48
+ extract($args); // Make before_widget, etc available.
49
+
50
+ $title = apply_filters('title', $instance['title']);
51
+
52
+
53
+
54
+ echo $before_widget;
55
+
56
+ if (!empty($title)) { echo $before_title . $title . $after_title; }
57
+
58
  $TwitterUserName = apply_filters( 'weblizar_twitter_user_name', $instance['TwitterUserName'] );
59
  $Theme = apply_filters( 'weblizar_twitter_theme', $instance['Theme'] );
60
  $Height = apply_filters( 'weblizar_twitter_height', $instance['Height'] );
64
  $AutoExpandPhotos = apply_filters( 'weblizar_twitter_auto_expand_photo', $instance['AutoExpandPhotos'] );
65
  $TwitterWidgetId = apply_filters( 'weblizar_twitter_widget_id', $instance['TwitterWidgetId'] );
66
  ?>
67
+
68
+ <div style="display:block;width:100%;float:left;overflow:hidden">
69
+ <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/<?php echo $TwitterUserName; ?>" min-width="<?php echo $Width; ?>" height="<?php echo $Height; ?>" data-theme="<?php echo $Theme; ?>" data-link-color="<?php echo $LinkColor; ?>px" data-widget-id="<?php echo $TwitterWidgetId; ?>">Twitter Tweets</a>
70
+ <script>
71
+ !function(d,s,id) {
72
+ 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);}
73
+ } (document,"script","twitter-wjs");
74
+ </script>
75
+ </div>
 
 
 
 
 
 
 
 
 
 
 
76
  <?php
77
+ echo $after_widget;
78
  }
79
 
80
  /**
131
  } else {
132
  $TwitterWidgetId = "462084801944485888";
133
  }
134
+
135
+ if ( isset( $instance[ 'title' ] ) ) {
136
+ $title = $instance[ 'title' ];
137
+ }
138
+ else {
139
+ $title = __( 'Tweets', 'weblizar' );
140
+ }
141
+ ?>
142
+ <p>
143
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
144
+ <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>">
145
+ </p>
146
+
147
  <p>
148
  <label for="<?php echo $this->get_field_id( 'TwitterUserName' ); ?>"><?php _e( 'Twitter Username' ); ?></label>
149
  <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 ); ?>">
210
  */
211
  public function update( $new_instance, $old_instance ) {
212
  $instance = array();
213
+ $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : 'Tweets';
214
  $instance['TwitterUserName'] = ( ! empty( $new_instance['TwitterUserName'] ) ) ? strip_tags( $new_instance['TwitterUserName'] ) : 'weblizar';
215
  $instance['Theme'] = ( ! empty( $new_instance['Theme'] ) ) ? strip_tags( $new_instance['Theme'] ) : 'light';
216
  $instance['Height'] = ( ! empty( $new_instance['Height'] ) ) ? strip_tags( $new_instance['Height'] ) : '450';