WP Social Sharing - Version 1.6

Version Description

  • February 10, 2015
Download this release

Release Info

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

Code changes from version 1.5 to 1.6

includes/class-admin.php CHANGED
@@ -13,7 +13,7 @@ class SS_Admin {
13
 
14
  add_action( 'admin_init', array( $this, 'register_settings' ) );
15
  add_action( 'admin_menu', array( $this, 'add_menu_item' ) );
16
-
17
  add_filter( "plugin_action_links_wp-social-sharing/index.php", array( $this, 'add_settings_link' ) );
18
 
19
  if ( isset( $_GET['page'] ) && $_GET['page'] === 'wp-social-sharing' ) {
@@ -31,15 +31,19 @@ class SS_Admin {
31
  'twitter_text'=>"Share on Twitter",
32
  'googleplus_text'=>"Share on Google+",
33
  'linkedin_text'=>"Share on Linkedin",
 
 
34
  'show_icons'=>'0',
35
  );
36
  update_option( 'wp_social_sharing', $defaults );
37
- update_option( 'wss_wp_social_sharing','f,t,g,l');
38
  update_option( 'wss_pluign_version ',SS_VERSION);
39
  }
40
 
41
  public function load_css() {
42
- wp_enqueue_style( 'social-sharing', SS_PLUGIN_URL . 'static/admin-styles.css' );
 
 
43
  }
44
 
45
  public function register_settings() {
@@ -51,6 +55,9 @@ class SS_Admin {
51
  $settings['facebook_text'] = trim( strip_tags( $settings['facebook_text'] ) );
52
  $settings['twitter_text'] = trim( strip_tags( $settings['twitter_text'] ) );
53
  $settings['googleplus_text'] = trim( strip_tags( $settings['googleplus_text'] ) );
 
 
 
54
  $settings['auto_add_post_types'] = ( isset( $settings['auto_add_post_types'] ) ) ? $settings['auto_add_post_types'] : array();
55
  $settings['show_sharebutton'] = ( isset( $settings['show_sharebutton'] ) ) ? $settings['show_sharebutton'] : array();
56
  return $settings;
13
 
14
  add_action( 'admin_init', array( $this, 'register_settings' ) );
15
  add_action( 'admin_menu', array( $this, 'add_menu_item' ) );
16
+
17
  add_filter( "plugin_action_links_wp-social-sharing/index.php", array( $this, 'add_settings_link' ) );
18
 
19
  if ( isset( $_GET['page'] ) && $_GET['page'] === 'wp-social-sharing' ) {
31
  'twitter_text'=>"Share on Twitter",
32
  'googleplus_text'=>"Share on Google+",
33
  'linkedin_text'=>"Share on Linkedin",
34
+ 'pinterest_text'=>"Share on Pinterest",
35
+ 'pinterest_image'=>"",
36
  'show_icons'=>'0',
37
  );
38
  update_option( 'wp_social_sharing', $defaults );
39
+ update_option( 'wss_wp_social_sharing','f,t,g,l,p');
40
  update_option( 'wss_pluign_version ',SS_VERSION);
41
  }
42
 
43
  public function load_css() {
44
+ wp_enqueue_style ( 'wp-social-sharing', SS_PLUGIN_URL . 'static/admin-styles.css' );
45
+ wp_enqueue_media();
46
+ wp_enqueue_script( 'wp-social-sharing', SS_PLUGIN_URL . 'static/socialshareadmin.js', array(), SS_VERSION, true );
47
  }
48
 
49
  public function register_settings() {
55
  $settings['facebook_text'] = trim( strip_tags( $settings['facebook_text'] ) );
56
  $settings['twitter_text'] = trim( strip_tags( $settings['twitter_text'] ) );
57
  $settings['googleplus_text'] = trim( strip_tags( $settings['googleplus_text'] ) );
58
+ $settings['linkedin_text'] = trim( strip_tags( $settings['linkedin_text'] ) );
59
+ $settings['pinterest_text'] = trim( strip_tags( $settings['pinterest_text'] ) );
60
+ $settings['pinterest_image'] = trim( strip_tags( $settings['pinterest_image'] ) );
61
  $settings['auto_add_post_types'] = ( isset( $settings['auto_add_post_types'] ) ) ? $settings['auto_add_post_types'] : array();
62
  $settings['show_sharebutton'] = ( isset( $settings['show_sharebutton'] ) ) ? $settings['show_sharebutton'] : array();
63
  return $settings;
includes/class-public.php CHANGED
@@ -52,7 +52,9 @@ class SS_Public {
52
  'facebook_text' => __( 'Share on Facebook', 'social-sharing' ),
53
  'googleplus_text' => __( 'Share on Google+', 'social-sharing' ),
54
  'linkedin_text' => __('Share on Linkedin', 'social-sharing' ),
55
- 'icon_order'=>'f,t,g,l',
 
 
56
  'show_icons'=>'0'
57
  ),$atts));
58
 
@@ -67,6 +69,21 @@ class SS_Public {
67
 
68
  $loadjs='';
69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  $opts=ss_get_options();
71
  foreach ($opts['load_static'] as $static){
72
  if($static == 'load_js'){
@@ -78,6 +95,7 @@ class SS_Public {
78
  $ssbutton_twitter='button-twitter';
79
  $ssbutton_googleplus='button-googleplus';
80
  $ssbutton_linkedin='button-linkedin';
 
81
  $sssocial_sharing='';
82
  if($show_icons){
83
  $sssocial_sharing='ss-social-sharing';
@@ -85,6 +103,7 @@ class SS_Public {
85
  $ssbutton_twitter='ss-button-twitter';
86
  $ssbutton_googleplus='ss-button-googleplus';
87
  $ssbutton_linkedin='ss-button-linkedin';
 
88
  }
89
  $icon_order=explode(',',$icon_order);
90
  ob_start();
@@ -113,6 +132,11 @@ class SS_Public {
113
  ?><a <?php echo $loadjs;?> rel="external nofollow" class="<?php echo $ssbutton_linkedin;?>" href="http://www.linkedin.com/shareArticle?mini=true&url=<?php echo substr($url,0,1024);?>&title=<?php echo substr($title,0,200);?>" target="_blank" ><?php echo $linkedin_text; ?></a><?php
114
  }
115
  break;
 
 
 
 
 
116
  }
117
  } ?>
118
  </div>
52
  'facebook_text' => __( 'Share on Facebook', 'social-sharing' ),
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
  ),$atts));
60
 
69
 
70
  $loadjs='';
71
 
72
+ $thumb = wp_get_attachment_image_src( get_post_thumbnail_id(get_the_ID()), 'medium' );
73
+ $thumb_url = $thumb['0'];
74
+ if($thumb_url == ''){
75
+ if($atts['pinterest_image'] == ''){
76
+ $thumb_url = SS_PLUGIN_URL.'static/blank.jpg';
77
+ }
78
+ else{
79
+ $thumb_url = $atts['pinterest_image'];
80
+ }
81
+ }
82
+ if($social_image == ''){
83
+ $social_image = $thumb_url;
84
+ }
85
+ $social_image = urlencode($social_image);
86
+
87
  $opts=ss_get_options();
88
  foreach ($opts['load_static'] as $static){
89
  if($static == 'load_js'){
95
  $ssbutton_twitter='button-twitter';
96
  $ssbutton_googleplus='button-googleplus';
97
  $ssbutton_linkedin='button-linkedin';
98
+ $ssbutton_pinterest='button-pinterest';
99
  $sssocial_sharing='';
100
  if($show_icons){
101
  $sssocial_sharing='ss-social-sharing';
103
  $ssbutton_twitter='ss-button-twitter';
104
  $ssbutton_googleplus='ss-button-googleplus';
105
  $ssbutton_linkedin='ss-button-linkedin';
106
+ $ssbutton_pinterest='ss-button-pinterest';
107
  }
108
  $icon_order=explode(',',$icon_order);
109
  ob_start();
132
  ?><a <?php echo $loadjs;?> rel="external nofollow" class="<?php echo $ssbutton_linkedin;?>" href="http://www.linkedin.com/shareArticle?mini=true&url=<?php echo substr($url,0,1024);?>&title=<?php echo substr($title,0,200);?>" target="_blank" ><?php echo $linkedin_text; ?></a><?php
133
  }
134
  break;
135
+ case 'p':
136
+ if(in_array('pinterest', $social_options)){
137
+ ?><a <?php echo $loadjs;?> rel="external nofollow" class="<?php echo $ssbutton_pinterest;?>" href="http://pinterest.com/pin/create/button/?url=<?php echo $url;?>&media=<?php echo $social_image;?>&description=<?php echo $title;?>" target="_blank" ><?php echo $pinterest_text; ?></a><?php
138
+ }
139
+ break;
140
  }
141
  } ?>
142
  </div>
includes/plugin.php CHANGED
@@ -13,12 +13,14 @@ function ss_get_options()
13
  $defaults = array(
14
  'twitter_username' => "",
15
  'auto_add_post_types' => array( 'post' ),
16
- 'social_options'=>array('facebook','twitter','googleplus','linkedin'),
17
  'load_static'=>array('load_css','load_js'),
18
  'facebook_text'=>"Share on Facebook",
19
  'twitter_text'=>"Share on Twitter",
20
  'googleplus_text'=>"Share on Google+",
21
  'linkedin_text'=>"Share on Linkedin",
 
 
22
  );
23
 
24
  $db_option = get_option( 'wp_social_sharing', array());
13
  $defaults = array(
14
  'twitter_username' => "",
15
  'auto_add_post_types' => array( 'post' ),
16
+ 'social_options'=>array('facebook','twitter','googleplus','linkedin','pinterest'),
17
  'load_static'=>array('load_css','load_js'),
18
  'facebook_text'=>"Share on Facebook",
19
  'twitter_text'=>"Share on Twitter",
20
  'googleplus_text'=>"Share on Google+",
21
  'linkedin_text'=>"Share on Linkedin",
22
+ 'pinterest_text'=>"Share on Pinterest",
23
+ 'pinterest_image'=>"",
24
  );
25
 
26
  $db_option = get_option( 'wp_social_sharing', array());
includes/settings-page.php CHANGED
@@ -21,6 +21,7 @@ if( ! defined("SS_VERSION") ) {
21
  <input type="checkbox" id="twitter_share" name="wp_social_sharing[social_options][]" value="twitter" <?php checked( in_array( 'twitter', $opts['social_options'] ), true ); ?> /><label for="twitter_share"><?php echo _e('Twitter','wp-social-sharing')?></label>
22
  <input type="checkbox" id="googleplus_share" name="wp_social_sharing[social_options][]" value="googleplus" <?php checked( in_array( 'googleplus', $opts['social_options'] ), true ); ?> /><label for="googleplus_share"><?php echo _e('Google Plus','wp-social-sharing')?></label>
23
  <input type="checkbox" id="linkedin_share" name="wp_social_sharing[social_options][]" value="linkedin" <?php checked( in_array( 'linkedin', $opts['social_options'] ), true ); ?> /><label for="linkedin_share"><?php echo _e('Linkedin','wp-social-sharing')?></label>
 
24
  </td>
25
  </tr>
26
  <tr valign="top">
@@ -28,7 +29,7 @@ if( ! defined("SS_VERSION") ) {
28
  <td>
29
  <div class="dndicon">
30
  <?php $s_order=get_option('wss_wp_social_sharing');
31
- if(empty($s_order)) $s_order='f,t,g,l';
32
  $io=explode(',',rtrim($s_order,','));
33
  foreach ($io as $i){
34
  switch($i){
@@ -44,6 +45,9 @@ if( ! defined("SS_VERSION") ) {
44
  case 'l':
45
  echo '<div class="s-icon linkedin-icon" id="l"></div>';
46
  break;
 
 
 
47
  }
48
  }?>
49
  </div>
@@ -71,13 +75,28 @@ if( ! defined("SS_VERSION") ) {
71
  <tr valign="top">
72
  <th><label for="googleplus_text"><?php _e('Google plus share button text','wp-social-sharing');?></label></th>
73
  <td>
74
- <input type="text" name="wp_social_sharing[googleplus_text]" id="googleplus_text" class="widefat" value="<?php echo esc_attr($opts['googleplus_text']); ?>">
75
  </td>
76
  </tr>
77
  <tr valign="top">
78
  <th><label for="linkedin_text"><?php _e('Linkedin share button text','wp-social-sharing');?></label></th>
79
  <td>
80
- <input type="text" name="wp_social_sharing[linkedin_text]" id="linkedin_text" class="widefat" value="<?php echo esc_attr($opts['linkedin_text']); ?>">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  </td>
82
  </tr>
83
  <tr>
21
  <input type="checkbox" id="twitter_share" name="wp_social_sharing[social_options][]" value="twitter" <?php checked( in_array( 'twitter', $opts['social_options'] ), true ); ?> /><label for="twitter_share"><?php echo _e('Twitter','wp-social-sharing')?></label>
22
  <input type="checkbox" id="googleplus_share" name="wp_social_sharing[social_options][]" value="googleplus" <?php checked( in_array( 'googleplus', $opts['social_options'] ), true ); ?> /><label for="googleplus_share"><?php echo _e('Google Plus','wp-social-sharing')?></label>
23
  <input type="checkbox" id="linkedin_share" name="wp_social_sharing[social_options][]" value="linkedin" <?php checked( in_array( 'linkedin', $opts['social_options'] ), true ); ?> /><label for="linkedin_share"><?php echo _e('Linkedin','wp-social-sharing')?></label>
24
+ <input type="checkbox" id="pinterest_share" name="wp_social_sharing[social_options][]" value="pinterest" <?php checked( in_array( 'pinterest', $opts['social_options'] ), true ); ?> /><label for="pinterest_share"><?php echo _e('Pinterest','wp-social-sharing')?></label>
25
  </td>
26
  </tr>
27
  <tr valign="top">
29
  <td>
30
  <div class="dndicon">
31
  <?php $s_order=get_option('wss_wp_social_sharing');
32
+ if(empty($s_order)) $s_order='f,t,g,l,p';
33
  $io=explode(',',rtrim($s_order,','));
34
  foreach ($io as $i){
35
  switch($i){
45
  case 'l':
46
  echo '<div class="s-icon linkedin-icon" id="l"></div>';
47
  break;
48
+ case 'p':
49
+ echo '<div class="s-icon pinterest-icon" id="p"></div>';
50
+ break;
51
  }
52
  }?>
53
  </div>
75
  <tr valign="top">
76
  <th><label for="googleplus_text"><?php _e('Google plus share button text','wp-social-sharing');?></label></th>
77
  <td>
78
+ <input type="text" name="wp_social_sharing[googleplus_text]" id="googleplus_text" class="widefat" value="<?php echo esc_attr($opts['googleplus_text']); ?>" />
79
  </td>
80
  </tr>
81
  <tr valign="top">
82
  <th><label for="linkedin_text"><?php _e('Linkedin share button text','wp-social-sharing');?></label></th>
83
  <td>
84
+ <input type="text" name="wp_social_sharing[linkedin_text]" id="linkedin_text" class="widefat" value="<?php echo esc_attr($opts['linkedin_text']); ?>" />
85
+ </td>
86
+ </tr>
87
+ <tr valign="top">
88
+ <th><label for="pinterest_text"><?php _e('Pinterest share button text','wp-social-sharing');?></label></th>
89
+ <td>
90
+ <input type="text" name="wp_social_sharing[pinterest_text]" id="pinterest_text" class="widefat" value="<?php echo esc_attr($opts['pinterest_text']); ?>" />
91
+ </td>
92
+ </tr>
93
+ <tr valign="top">
94
+ <th><label for="pinterest_image"><?php _e('Default share image','wp-social-sharing')?></label></th>
95
+ <td>
96
+ <input type="text" name="wp_social_sharing[pinterest_image]" id="pinterest_image" value="<?php echo esc_attr($opts['pinterest_image']); ?>"/><input type="button" class="set_custom_images button" id="set_custom_images" value="<?php _e('Upload','wp-social-sharing')?>" />
97
+ <input type="button" class="button" id="remove_custom_images" value="<?php _e('Remove','wp-social-sharing')?>" />
98
+ <br /><small><?php _e('Required for Pinterest', 'wp-social-sharing'); ?></small>
99
+ <div id="set_custom_image_src"><?php if($opts['pinterest_image'] != ''): ?><img src="<?php echo $opts['pinterest_image'];?>" width="100px" /> <?php endif;?></div>
100
  </td>
101
  </tr>
102
  <tr>
index.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /*
3
  Plugin Name: WP Social Sharing
4
- Version: 1.5
5
  Plugin URI: http://wordpress.org/plugins/wp-social-sharing/
6
- Description: Adds very attractive responsive social sharing buttons of Facebook, Twitter, Linkedin and Google+ to wordpress posts, pages or media.
7
  Author: Arjun Jain
8
  Author URI: http://www.arjunjain.info/
9
  Text Domain: wp-social-sharing
@@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) {
16
  exit;
17
  }
18
 
19
- define( "SS_VERSION", "1.3" ); // db versioin
20
  define( "SS_PLUGIN_DIR", plugin_dir_path( __FILE__ ) );
21
  define( "SS_PLUGIN_URL", plugins_url( '/' , __FILE__ ) );
22
 
@@ -39,12 +39,23 @@ function wss_update_db_check_while_plugin_upgrade(){
39
  if($db_version === FALSE)
40
  $db_version='1.0';
41
 
42
- // change for linkedin button
43
- if($db_version != '1.3' ){
44
- update_option('wss_wp_social_sharing','f,t,g,l');
 
45
  $default=get_option('wp_social_sharing');
46
  $default['linkedin_text']='Share on Linkedin';
 
47
  update_option('wp_social_sharing',$default);
48
- update_option('wss_plugin_version','1.3');
49
  }
50
- }
 
 
 
 
 
 
 
 
 
1
  <?php
2
  /*
3
  Plugin Name: WP Social Sharing
4
+ Version: 1.6
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
8
  Author URI: http://www.arjunjain.info/
9
  Text Domain: wp-social-sharing
16
  exit;
17
  }
18
 
19
+ define( "SS_VERSION", "1.4" ); // db versioin
20
  define( "SS_PLUGIN_DIR", plugin_dir_path( __FILE__ ) );
21
  define( "SS_PLUGIN_URL", plugins_url( '/' , __FILE__ ) );
22
 
39
  if($db_version === FALSE)
40
  $db_version='1.0';
41
 
42
+ // change for linkedin button
43
+ // Upgrade from db version lower than 1.3 to 1.4
44
+ if($db_version == '1.0' ){
45
+ update_option('wss_wp_social_sharing','f,t,g,l,p');
46
  $default=get_option('wp_social_sharing');
47
  $default['linkedin_text']='Share on Linkedin';
48
+ $default['pinterest_text']='Share on Pinterest';
49
  update_option('wp_social_sharing',$default);
50
+ update_option('wss_plugin_version','1.4');
51
  }
52
+ else if($db_version == '1.3'){ // update db from version 1.3 to 1.4
53
+ $current_wss_option=get_option('wss_wp_social_sharing');
54
+ $current_wss_option = $current_wss_option.',p';
55
+ update_option('wss_wp_social_sharing',$current_wss_option);
56
+ $default=get_option('wp_social_sharing');
57
+ $default['pinterest_text']='Share on Pinterest';
58
+ update_option('wp_social_sharing',$default);
59
+ update_option('wss_plugin_version','1.4');
60
+ }
61
+ }
readme.txt CHANGED
@@ -3,22 +3,22 @@ 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, custom post type
7
  Requires at least: 3.5
8
- Tested up to: 4.1.0
9
- Stable tag: 1.5
10
  License: GPLv3
11
 
12
- Adds very attractive responsive social sharing buttons of Facebook, Twitter, Linkedin and Google+ to wordpress posts, pages or media.
13
 
14
  == Description ==
15
 
16
- WP Social sharing adds very attractive responsive social share buttons of Facebook, Twitter, Linkedin and Google+ to wordpress posts, page, media or any custom post type. This is very lightweight and simple social sharing plugin. This plugin provide option whether you want to include plugin CSS/JS or not.
17
  Most of the social sharing plugins uses images/api to display social share buttons, but this plugin created large social sharing buttons using CSS3. Also these social sharing buttons are responsive. For device width <strong>less than 480px</strong> these buttons converted into their respective icons.
18
 
19
  **Plugin Features**
20
 
21
- - Social sharing support for Facebook, Google+, Linkedin and Twitter.
22
  - Auto display to Post, Page, Media and Custom Post type.
23
  - Custom Social Button text.
24
  - 100% responsive.
@@ -30,7 +30,7 @@ Most of the social sharing plugins uses images/api to display social share butto
30
  You can also use following shortcode
31
 
32
  `
33
- [wp_social_sharing social_options='facebook,twitter,googleplus,linkedin' twitter_username='arjun077' facebook_text='Share on Facebook' twitter_text='Share on Twitter' googleplus_text='Share on Google+' linkedin_text='Share on Linkedin' icon_order='f,t,g,l' show_icons='0']
34
  `
35
  [Demo](http://www.arjunjain.info/wp-social-sharing/)
36
 
@@ -52,6 +52,9 @@ You can also use following shortcode
52
  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.
53
 
54
  == Changelog ==
 
 
 
55
 
56
  = 1.5 - January 19, 2015 =
57
  - Fixed button text
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.6
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.
13
 
14
  == Description ==
15
 
16
+ WP Social sharing adds very attractive responsive social share buttons of Facebook, Twitter, Linkedin, Google+ and Pinterest to wordpress posts, page, media or any custom post type. This is very lightweight and simple social sharing plugin. This plugin provide option whether you want to include plugin CSS/JS or not.
17
  Most of the social sharing plugins uses images/api to display social share buttons, but this plugin created large social sharing buttons using CSS3. Also these social sharing buttons are responsive. For device width <strong>less than 480px</strong> these buttons converted into their respective icons.
18
 
19
  **Plugin Features**
20
 
21
+ - Social sharing support for Facebook, Google+, Linkedin, Twitter and Pinterest.
22
  - Auto display to Post, Page, Media and Custom Post type.
23
  - Custom Social Button text.
24
  - 100% responsive.
30
  You can also use following shortcode
31
 
32
  `
33
+ [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']
34
  `
35
  [Demo](http://www.arjunjain.info/wp-social-sharing/)
36
 
52
  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.
53
 
54
  == Changelog ==
55
+ = 1.6 - February 10, 2015 =
56
+ - Add Pinterest share button
57
+ - Update button CSS
58
 
59
  = 1.5 - January 19, 2015 =
60
  - Fixed button text
static/admin-styles.css CHANGED
@@ -13,7 +13,7 @@
13
  .dndicon .googleplus-icon {background-position: -45px -45px;}
14
  .dndicon .facebook-icon{background-position: -90px -45px;}
15
  .dndicon .linkedin-icon{background-position: -135px -45px;}
16
-
17
  @media(max-width: 919px) {
18
  .ss-column{float: none;width: 100%;}
19
  .ss-secondary{ padding:0; margin:25px 0; border-left:0;}
13
  .dndicon .googleplus-icon {background-position: -45px -45px;}
14
  .dndicon .facebook-icon{background-position: -90px -45px;}
15
  .dndicon .linkedin-icon{background-position: -135px -45px;}
16
+ .dndicon .pinterest-icon{background-position: -180px -45px;}
17
  @media(max-width: 919px) {
18
  .ss-column{float: none;width: 100%;}
19
  .ss-secondary{ padding:0; margin:25px 0; border-left:0;}
static/blank.jpg ADDED
Binary file
static/socialshare.css CHANGED
@@ -1,6 +1,6 @@
1
  @CHARSET "UTF-8";
2
  .social-sharing{width: 100%; clear: both;}
3
- a.button-facebook,a.button-googleplus,a.button-twitter,a.button-linkedin {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);}
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;}
6
  a.button-googleplus { background-color: #c33219;background: -moz-linear-gradient(top, #e64522, #c33219);background: -ms-linear-gradient(top, #e64522, #c33219);background: -webkit-linear-gradient(top, #e64522, #c33219);text-shadow: 0 -1px -1px #972412;}
@@ -9,20 +9,24 @@ a.button-twitter {background-color: #0081ce;background: -moz-linear-gradient(top
9
  a.button-twitter:hover {background-color: #00aced;background: -moz-linear-gradient(top, #0081ce, #00aced);background: -ms-linear-gradient(top, #0081ce, #00aced);background: -webkit-linear-gradient(top, #0081ce, #00aced);color:#fff;}
10
  a.button-linkedin {background-color: #0073b2;background: -moz-linear-gradient(top, #009cda, #0073b2);background:-ms-linear-gradient(top, #009cda, #0073b2);background: -webkit-linear-gradient(top, #009cda, #0073b2);text-shadow: 0 -1px -1px #005486;}
11
  a.button-linkedin:hover{background-color: #009cda;background: -moz-linear-gradient(top, #0073b2, #009cda);background: -ms-linear-gradient(top, #0073b2, #009cda);background: -webkit-linear-gradient(top, #0073b2, #009cda);color:#fff;}
 
 
12
 
13
  .ss-social-sharing a{text-indent: -99999px;}
14
- a.ss-button-facebook, a.ss-button-googleplus, a.ss-button-twitter, a.ss-button-linkedin{background-image: url(socialshare.png);width: 45px;height: 45px;background-repeat: no-repeat;padding: 0px;border: 0px;margin:1% 1% 1% 0;display: inline-block;}
15
  a.ss-button-twitter{background-position:0px -45px;}a.ss-button-twitter:hover{background-position:0px 0px;transition-delay: 0s;transition-duration: 250ms;transition-property: all; transition-timing-function: ease-in-out;}
16
  a.ss-button-googleplus{background-position: -45px -45px;}a.ss-button-googleplus:hover{background-position: -45px 0px;transition-delay: 0s;transition-duration: 250ms;transition-property: all; transition-timing-function: ease-in-out;}
17
  a.ss-button-facebook{background-position: -90px -45px;}a.ss-button-facebook:hover{background-position: -90px 0px;transition-delay: 0s;transition-duration: 250ms;transition-property: all; transition-timing-function: ease-in-out;}
18
  a.ss-button-linkedin{background-position: -135px -45px;}a.ss-button-linkedin:hover{background-position: -135px 0px;transition-delay: 0s;transition-duration: 250ms;transition-property: all; transition-timing-function: ease-in-out;}
 
19
 
20
  /* Smartphones (portrait and landscape) */
21
  @media (max-width : 480px){
22
  .social-sharing a{text-indent: -99999px;}
23
- a.button-facebook, a.button-googleplus,a.button-twitter,a.button-linkedin{background-image: url(socialshare.png) !important;width: 45px;height: 45px;background-repeat: no-repeat;padding: 0px;border: 0px;}
24
- a.button-twitter{background-position:0px -45px; }a.button-facebook:hover{background-position:0px 0px;transition-delay: 0s;transition-duration: 250ms;transition-property: all; transition-timing-function: ease-in-out;}
25
- a.button-googleplus{background-position: -45px -45px;}a.button-twitter:hover{background-position: -45px 0px;transition-delay: 0s;transition-duration: 250ms;transition-property: all; transition-timing-function: ease-in-out;}
26
- a.button-facebook{background-position: -90px -45px;}a.button-googleplus:hover{background-position: -90px 0px;transition-delay: 0s;transition-duration: 250ms;transition-property: all; transition-timing-function: ease-in-out;}
27
- a.button-linkedin{background-position: -135px -45px;}a.button-googleplus:hover{background-position: -135px 0px;transition-delay: 0s;transition-duration: 250ms;transition-property: all; transition-timing-function: ease-in-out;}
28
- }
 
1
  @CHARSET "UTF-8";
2
  .social-sharing{width: 100%; clear: both;}
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;}
6
  a.button-googleplus { background-color: #c33219;background: -moz-linear-gradient(top, #e64522, #c33219);background: -ms-linear-gradient(top, #e64522, #c33219);background: -webkit-linear-gradient(top, #e64522, #c33219);text-shadow: 0 -1px -1px #972412;}
9
  a.button-twitter:hover {background-color: #00aced;background: -moz-linear-gradient(top, #0081ce, #00aced);background: -ms-linear-gradient(top, #0081ce, #00aced);background: -webkit-linear-gradient(top, #0081ce, #00aced);color:#fff;}
10
  a.button-linkedin {background-color: #0073b2;background: -moz-linear-gradient(top, #009cda, #0073b2);background:-ms-linear-gradient(top, #009cda, #0073b2);background: -webkit-linear-gradient(top, #009cda, #0073b2);text-shadow: 0 -1px -1px #005486;}
11
  a.button-linkedin:hover{background-color: #009cda;background: -moz-linear-gradient(top, #0073b2, #009cda);background: -ms-linear-gradient(top, #0073b2, #009cda);background: -webkit-linear-gradient(top, #0073b2, #009cda);color:#fff;}
12
+ a.button-pinterest {background-color: #a0171c;background: -moz-linear-gradient(top, #cb2027, #a0171c);background: -ms-linear-gradient(top, #cb2027, #a0171c);background: -webkit-linear-gradient(top, #cb2027, #a0171c);text-shadow: 0 -1px -1px #761114;}
13
+ a.button-pinterest:hover{background-color: #cb2027; background: -moz-linear-gradient(top, #a0171c, #cb2027);background: -ms-linear-gradient(top, #a0171c, #cb2027);background: -webkit-linear-gradient(top, #a0171c, #cb2027);color:#fff;}
14
 
15
  .ss-social-sharing a{text-indent: -99999px;}
16
+ a.ss-button-facebook, a.ss-button-googleplus, a.ss-button-twitter, a.ss-button-linkedin,a.ss-button-pinterest{background-image: url(socialshare.png);width: 45px;height: 45px;background-repeat: no-repeat;padding: 0px;border: 0px;margin:1% 1% 1% 0;display: inline-block;}
17
  a.ss-button-twitter{background-position:0px -45px;}a.ss-button-twitter:hover{background-position:0px 0px;transition-delay: 0s;transition-duration: 250ms;transition-property: all; transition-timing-function: ease-in-out;}
18
  a.ss-button-googleplus{background-position: -45px -45px;}a.ss-button-googleplus:hover{background-position: -45px 0px;transition-delay: 0s;transition-duration: 250ms;transition-property: all; transition-timing-function: ease-in-out;}
19
  a.ss-button-facebook{background-position: -90px -45px;}a.ss-button-facebook:hover{background-position: -90px 0px;transition-delay: 0s;transition-duration: 250ms;transition-property: all; transition-timing-function: ease-in-out;}
20
  a.ss-button-linkedin{background-position: -135px -45px;}a.ss-button-linkedin:hover{background-position: -135px 0px;transition-delay: 0s;transition-duration: 250ms;transition-property: all; transition-timing-function: ease-in-out;}
21
+ a.ss-button-pinterest{background-position: -180px -45px;}a.ss-button-pinterest:hover{background-position: -180px 0px;transition-delay: 0s;transition-duration: 250ms;transition-property: all; transition-timing-function: ease-in-out;}
22
 
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;}
30
+ a.button-linkedin{background-position: -135px -45px;}a.button-linkedin:hover{background-position: -135px 0px;transition-delay: 0s;transition-duration: 250ms;transition-property: all; transition-timing-function: ease-in-out;}
31
+ a.button-pinterest{background-position: -180px -45px;}a.button-pinterest:hover{background-position: -180px 0px;transition-delay: 0s;transition-duration: 250ms;transition-property: all; transition-timing-function: ease-in-out;}
32
+ }
static/socialshare.png CHANGED
Binary file
static/socialshareadmin.js ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($){
2
+ if ($('#set_custom_images').length > 0) {
3
+ if ( typeof wp !== 'undefined' && wp.media && wp.media.editor) {
4
+ jQuery('.wrap').on('click', '#set_custom_images', function(e) {
5
+ e.preventDefault();
6
+ var button = jQuery(this);
7
+ var id = button.prev();
8
+ wp.media.editor.send.attachment = function(props, attachment) {
9
+ id.val(attachment.url);
10
+ $('#set_custom_image_src').html('<img src="'+attachment.url+'" width="100px" />');
11
+ };
12
+ wp.media.editor.open(button);
13
+ return false;
14
+ });
15
+ }
16
+ }
17
+ $("#remove_custom_images").on('click',function(){
18
+ $('#pinterest_image').val('');
19
+ $('#set_custom_image_src').html('');
20
+ });
21
+ });