WP Social Sharing - Version 1.8

Version Description

  • August 18, 2015
Download this release

Release Info

Developer arjunjain08
Plugin Icon wp plugin WP Social Sharing
Version 1.8
Comparing to
See all releases

Code changes from version 1.7 to 1.8

includes/class-admin.php CHANGED
@@ -26,6 +26,7 @@ class SS_Admin {
26
  'twitter_username' => "",
27
  'auto_add_post_types' => array( 'post' ),
28
  'social_options'=>array('facebook','twitter','googleplus'),
 
29
  'load_static'=>array('load_css','load_js'),
30
  'facebook_text'=>"Share on Facebook",
31
  'twitter_text'=>"Share on Twitter",
@@ -34,7 +35,8 @@ class SS_Admin {
34
  'pinterest_text'=>"Share on Pinterest",
35
  'pinterest_image'=>"",
36
  'show_icons'=>'0',
37
- 'before_button_text'=>''
 
38
  );
39
  update_option( 'wp_social_sharing', $defaults );
40
  update_option( 'wss_wp_social_sharing','f,t,g,l,p');
26
  'twitter_username' => "",
27
  'auto_add_post_types' => array( 'post' ),
28
  'social_options'=>array('facebook','twitter','googleplus'),
29
+ 'social_icon_position'=>'after',
30
  'load_static'=>array('load_css','load_js'),
31
  'facebook_text'=>"Share on Facebook",
32
  'twitter_text'=>"Share on Twitter",
35
  'pinterest_text'=>"Share on Pinterest",
36
  'pinterest_image'=>"",
37
  'show_icons'=>'0',
38
+ 'before_button_text'=>'',
39
+ 'text_position'=>'left'
40
  );
41
  update_option( 'wp_social_sharing', $defaults );
42
  update_option( 'wss_wp_social_sharing','f,t,g,l,p');
includes/class-public.php CHANGED
@@ -28,7 +28,14 @@ class SS_Public {
28
  return $content;
29
  }
30
  $opts['icon_order']=get_option('wss_wp_social_sharing');
31
- return $content . $this->social_sharing($opts);
 
 
 
 
 
 
 
32
  }
33
 
34
  public function load_assets()
@@ -53,10 +60,11 @@ class SS_Public {
53
  'googleplus_text' => __( 'Share on Google+', 'social-sharing' ),
54
  'linkedin_text' => __('Share on Linkedin', 'social-sharing' ),
55
  'pinterest_text'=>__('Share on Pinterest','social-sharing'),
56
- 'social_image'=> '',
57
  'icon_order'=>'f,t,g,l,p',
 
58
  'show_icons'=>'0',
59
- 'before_button_text'=>''
 
60
  ),$atts));
61
 
62
  if(!is_array($social_options))
@@ -110,8 +118,8 @@ class SS_Public {
110
  ob_start();
111
  ?>
112
  <div class="social-sharing <?php echo $sssocial_sharing;?>">
113
- <?php if(!empty($before_button_text)):?>
114
- <span><?php echo $before_button_text; ?></span>
115
  <?php endif;?>
116
  <?php
117
  foreach($icon_order as $o) {
@@ -143,6 +151,9 @@ class SS_Public {
143
  break;
144
  }
145
  } ?>
 
 
 
146
  </div>
147
  <?php
148
  $output = ob_get_contents();
28
  return $content;
29
  }
30
  $opts['icon_order']=get_option('wss_wp_social_sharing');
31
+
32
+ if($opts['social_icon_position'] == 'before' ){
33
+ return $this->social_sharing($opts).$content;
34
+ }
35
+ else{
36
+ return $content . $this->social_sharing($opts);
37
+ }
38
+
39
  }
40
 
41
  public function load_assets()
60
  'googleplus_text' => __( 'Share on Google+', 'social-sharing' ),
61
  'linkedin_text' => __('Share on Linkedin', 'social-sharing' ),
62
  'pinterest_text'=>__('Share on Pinterest','social-sharing'),
 
63
  'icon_order'=>'f,t,g,l,p',
64
+ 'social_image'=> '',
65
  'show_icons'=>'0',
66
+ 'before_button_text'=>'',
67
+ 'text_position'=> 'left'
68
  ),$atts));
69
 
70
  if(!is_array($social_options))
118
  ob_start();
119
  ?>
120
  <div class="social-sharing <?php echo $sssocial_sharing;?>">
121
+ <?php if(!empty($before_button_text) && ($text_position == 'left' || $text_position == 'top')):?>
122
+ <span class="<?php echo $text_position;?>"><?php echo $before_button_text; ?></span>
123
  <?php endif;?>
124
  <?php
125
  foreach($icon_order as $o) {
151
  break;
152
  }
153
  } ?>
154
+ <?php if(!empty($before_button_text) && ($text_position == 'bottom' || $text_position == 'right')):?>
155
+ <span class="<?php echo $text_position;?>"><?php echo $before_button_text; ?></span>
156
+ <?php endif;?>
157
  </div>
158
  <?php
159
  $output = ob_get_contents();
includes/plugin.php CHANGED
@@ -22,6 +22,7 @@ function ss_get_options()
22
  'pinterest_text'=>"Share on Pinterest",
23
  'pinterest_image'=>"",
24
  'before_button_text'=>'',
 
25
  );
26
 
27
  $db_option = get_option( 'wp_social_sharing', array());
22
  'pinterest_text'=>"Share on Pinterest",
23
  'pinterest_image'=>"",
24
  'before_button_text'=>'',
25
+ 'text_position' => 'left'
26
  );
27
 
28
  $db_option = get_option( 'wp_social_sharing', array());
includes/settings-page.php CHANGED
@@ -54,6 +54,15 @@ if( ! defined("SS_VERSION") ) {
54
  <br /><small><?php _e('Drag the social icon to change the order. No need to save.', 'wp-social-sharing'); ?></small>
55
  </td>
56
  </tr>
 
 
 
 
 
 
 
 
 
57
  <tr valign="top">
58
  <th><label for="alws_show_icons"><?php _e('Always show social icons','wp-social-sharing');?></label></th>
59
  <td>
@@ -66,6 +75,17 @@ if( ! defined("SS_VERSION") ) {
66
  <input type="text" class="widefat" name="wp_social_sharing[before_button_text]" id="before_button_text" value="<?php echo esc_attr($opts['before_button_text']); ?>" />
67
  </td>
68
  </tr>
 
 
 
 
 
 
 
 
 
 
 
69
  <tr valign="top">
70
  <th><label for="facebook_text"><?php _e('Facebook Share button text','wp-social-sharing');?></label></th>
71
  <td>
54
  <br /><small><?php _e('Drag the social icon to change the order. No need to save.', 'wp-social-sharing'); ?></small>
55
  </td>
56
  </tr>
57
+ <tr>
58
+ <th><label for="social_icon_position"><?php _e('Social Icon Position','wp-social-sharing');?></label></th>
59
+ <td>
60
+ <select name="wp_social_sharing[social_icon_position]">
61
+ <option value="before" <?php if($opts['social_icon_position'] == 'before') echo "selected='selected'"?>>Before Content</option>
62
+ <option value="after" <?php if($opts['social_icon_position'] == 'after') echo "selected='selected'"?>>After Content</option>
63
+ </select>
64
+ </td>
65
+ </tr>
66
  <tr valign="top">
67
  <th><label for="alws_show_icons"><?php _e('Always show social icons','wp-social-sharing');?></label></th>
68
  <td>
75
  <input type="text" class="widefat" name="wp_social_sharing[before_button_text]" id="before_button_text" value="<?php echo esc_attr($opts['before_button_text']); ?>" />
76
  </td>
77
  </tr>
78
+ <tr valign="top">
79
+ <th><label for="before_button_text"><?php _e('Text Position','wp-social-sharing');?></label></th>
80
+ <td>
81
+ <select name="wp_social_sharing[text_position]">
82
+ <option value="left" <?php if($opts['text_position'] == 'left') echo "selected='selected'"?>>Left</option>
83
+ <option value="right" <?php if($opts['text_position'] == 'right') echo "selected='selected'"?>>Right</option>
84
+ <option value="top" <?php if($opts['text_position'] == 'top') echo "selected='selected'"?>>Top</option>
85
+ <option value="bottom" <?php if($opts['text_position'] == 'bottom') echo "selected='selected'"?>>Bottom</option>
86
+ </select>
87
+ </td>
88
+ </tr>
89
  <tr valign="top">
90
  <th><label for="facebook_text"><?php _e('Facebook Share button text','wp-social-sharing');?></label></th>
91
  <td>
index.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: WP Social Sharing
4
- Version: 1.7
5
  Plugin URI: http://wordpress.org/plugins/wp-social-sharing/
6
  Description: Adds very attractive responsive social sharing buttons of Facebook, Twitter, Linkedin, Pinterest and Google+ to wordpress posts, pages or media.
7
  Author: Arjun Jain
1
  <?php
2
  /*
3
  Plugin Name: WP Social Sharing
4
+ Version: 1.8
5
  Plugin URI: http://wordpress.org/plugins/wp-social-sharing/
6
  Description: Adds very attractive responsive social sharing buttons of Facebook, Twitter, Linkedin, Pinterest and Google+ to wordpress posts, pages or media.
7
  Author: Arjun Jain
readme.txt CHANGED
@@ -3,10 +3,10 @@ Contributors: arjunjain08
3
  Author URI: http://www.arjunjain.info
4
  Plugin URI: http://wordpress.org/plugins/wp-social-sharing/
5
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=SQC4WR7X5JGDY&lc=IN&item_name=WP%20Social%20Sharing&item_number=7&button_subtype=services&currency_code=USD&bn=PP%2dBuyNowBF%3abtn_buynowCC_LG%2egif%3aNonHosted
6
- Tags: responsive social buttons, responsive social sharing buttons, responsive button, social buttons, social sharing, sharing buttons, twitter, googleplus, facebook, linkedin, pinterest, add to custom post type
7
  Requires at least: 3.5
8
- Tested up to: 4.2.2
9
- Stable tag: 1.7
10
  License: GPLv3
11
 
12
  Adds very attractive responsive social sharing buttons of Facebook, Twitter, Linkedin, Pinterest and Google+ to wordpress posts, pages or media.
@@ -31,7 +31,7 @@ Most of the social sharing plugins uses images/api to display social share butto
31
  You can also use following shortcode
32
 
33
  `
34
- [wp_social_sharing social_options='facebook,twitter,googleplus,linkedin,pinterest' twitter_username='arjun077' facebook_text='Share on Facebook' twitter_text='Share on Twitter' googleplus_text='Share on Google+' linkedin_text='Share on Linkedin' pinterest_text="Share on Pinterest" icon_order='f,t,g,l,p' show_icons='0' before_button_text='' social_image='']
35
  `
36
  [Demo](http://www.arjunjain.info/wp-social-sharing/)
37
 
@@ -53,6 +53,11 @@ You can also use following shortcode
53
  2. Alternatively, download the plugin and upload the contents of `wp-social-sharing.zip` to your plugins directory, which usually is `/wp-content/plugins/`. Activate the plugin.
54
 
55
  == Changelog ==
 
 
 
 
 
56
  = 1.7 - June 24, 2015 =
57
  - Add Text Before sharing buttons
58
 
3
  Author URI: http://www.arjunjain.info
4
  Plugin URI: http://wordpress.org/plugins/wp-social-sharing/
5
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=SQC4WR7X5JGDY&lc=IN&item_name=WP%20Social%20Sharing&item_number=7&button_subtype=services&currency_code=USD&bn=PP%2dBuyNowBF%3abtn_buynowCC_LG%2egif%3aNonHosted
6
+ Tags: responsive social buttons, responsive social sharing buttons, responsive button, social buttons, social sharing, sharing buttons, twitter share, googleplus share, facebook share, linkedin share, pinterest share, share button for custom post type
7
  Requires at least: 3.5
8
+ Tested up to: 4.3
9
+ Stable tag: 1.8
10
  License: GPLv3
11
 
12
  Adds very attractive responsive social sharing buttons of Facebook, Twitter, Linkedin, Pinterest and Google+ to wordpress posts, pages or media.
31
  You can also use following shortcode
32
 
33
  `
34
+ [wp_social_sharing social_options='facebook,twitter,googleplus,linkedin,pinterest' twitter_username='arjun077' facebook_text='Share on Facebook' twitter_text='Share on Twitter' googleplus_text='Share on Google+' linkedin_text='Share on Linkedin' pinterest_text="Share on Pinterest" icon_order='f,t,g,l,p' show_icons='0' before_button_text='' text_position='' social_image='']
35
  `
36
  [Demo](http://www.arjunjain.info/wp-social-sharing/)
37
 
53
  2. Alternatively, download the plugin and upload the contents of `wp-social-sharing.zip` to your plugins directory, which usually is `/wp-content/plugins/`. Activate the plugin.
54
 
55
  == Changelog ==
56
+
57
+ = 1.8 - August 18, 2015 =
58
+ - Add Text Position option in Settings page and Also in shortcode
59
+ - Add Social icon position option (Global Option)
60
+
61
  = 1.7 - June 24, 2015 =
62
  - Add Text Before sharing buttons
63
 
static/socialshare.css CHANGED
@@ -1,5 +1,7 @@
1
  @CHARSET "UTF-8";
2
- .social-sharing{width: 100%; clear: both;} .social-sharing span{display: inline-block;font-size: 110%;}
 
 
3
  a.button-facebook,a.button-googleplus,a.button-twitter,a.button-linkedin,a.button-pinterest{color: #fff;text-decoration:none;font-size: 16px;font-weight:normal; margin:1% 1% 1% 0;padding:5px 1%;padding:.5rem 1%;text-align:center;display: inline-block;text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);border:0px;}
4
  a.button-facebook {background-color: #2b4170;background: -moz-linear-gradient(top, #3b5998, #2b4170);background: -ms-linear-gradient(top, #3b5998, #2b4170);background: -webkit-linear-gradient(top, #3b5998, #2b4170);text-shadow: 0 -1px -1px #1f2f52;}
5
  a.button-facebook:hover {background-color: #3b5998;background: -moz-linear-gradient(top, #2b4170, #3b5998);background: -ms-linear-gradient(top, #2b4170, #3b5998);background: -webkit-linear-gradient(top, #2b4170, #3b5998);color:#fff;}
@@ -23,7 +25,7 @@ a.ss-button-pinterest{background-position: -180px -45px;}a.ss-button-pinterest:h
23
  /* Smartphones (portrait and landscape) */
24
  @media (max-width : 480px){
25
  .social-sharing a{text-indent: -99999px;}
26
- a.button-facebook, a.button-googleplus,a.button-twitter,a.button-linkedin,a.ss-button-pinterest{background-image: url(socialshare.png) !important;width: 45px;height: 45px;background-repeat: no-repeat;padding: 0px;border: 0px;}
27
  a.button-twitter{background-position:0px -45px; }a.button-twitter:hover{background-position:0px 0px;transition-delay: 0s;transition-duration: 250ms;transition-property: all; transition-timing-function: ease-in-out;}
28
  a.button-googleplus{background-position: -45px -45px;}a.button-googleplus:hover{background-position: -45px 0px;transition-delay: 0s;transition-duration: 250ms;transition-property: all; transition-timing-function: ease-in-out;}
29
  a.button-facebook{background-position: -90px -45px;}a.button-facebook:hover{background-position: -90px 0px;transition-delay: 0s;transition-duration: 250ms;transition-property: all; transition-timing-function: ease-in-out;}
1
  @CHARSET "UTF-8";
2
+ .social-sharing{width: 100%; clear: both;}
3
+ .social-sharing span{display: inline-block;font-size: 110%;}
4
+ .social-sharing span.top, .social-sharing span.bottom {width:100%;} .social-sharing span.right {display: inline;}
5
  a.button-facebook,a.button-googleplus,a.button-twitter,a.button-linkedin,a.button-pinterest{color: #fff;text-decoration:none;font-size: 16px;font-weight:normal; margin:1% 1% 1% 0;padding:5px 1%;padding:.5rem 1%;text-align:center;display: inline-block;text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);border:0px;}
6
  a.button-facebook {background-color: #2b4170;background: -moz-linear-gradient(top, #3b5998, #2b4170);background: -ms-linear-gradient(top, #3b5998, #2b4170);background: -webkit-linear-gradient(top, #3b5998, #2b4170);text-shadow: 0 -1px -1px #1f2f52;}
7
  a.button-facebook:hover {background-color: #3b5998;background: -moz-linear-gradient(top, #2b4170, #3b5998);background: -ms-linear-gradient(top, #2b4170, #3b5998);background: -webkit-linear-gradient(top, #2b4170, #3b5998);color:#fff;}
25
  /* Smartphones (portrait and landscape) */
26
  @media (max-width : 480px){
27
  .social-sharing a{text-indent: -99999px;}
28
+ a.button-facebook, a.button-googleplus,a.button-twitter,a.button-linkedin,a.button-pinterest{background-image: url(socialshare.png) !important;width: 45px;height: 45px;background-repeat: no-repeat;padding: 0px;border: 0px;}
29
  a.button-twitter{background-position:0px -45px; }a.button-twitter:hover{background-position:0px 0px;transition-delay: 0s;transition-duration: 250ms;transition-property: all; transition-timing-function: ease-in-out;}
30
  a.button-googleplus{background-position: -45px -45px;}a.button-googleplus:hover{background-position: -45px 0px;transition-delay: 0s;transition-duration: 250ms;transition-property: all; transition-timing-function: ease-in-out;}
31
  a.button-facebook{background-position: -90px -45px;}a.button-facebook:hover{background-position: -90px 0px;transition-delay: 0s;transition-duration: 250ms;transition-property: all; transition-timing-function: ease-in-out;}