WP Social Bookmarking Light - Version 2.0.6

Version Description

  • Fixed: pinterest behavior #59
Download this release

Release Info

Developer utahvich
Plugin Icon wp plugin WP Social Bookmarking Light
Version 2.0.6
Comparing to
See all releases

Code changes from version 2.0.5 to 2.0.6

readme.txt CHANGED
@@ -4,13 +4,14 @@ Donate link: https://gumroad.com/l/rWLrL
4
  Tags: social, bookmarks, bookmarking, Hatena, Twitter, Facebook, Tumblr, Google Bookmark, Delicious, Digg, reddit, LinkedIn, Instapaper, StumbleUpon, mixi, gree, atode, toread, line, pocket, Pinterest
5
  Requires at least: 4.0.0
6
  Tested up to: 4.7
7
- Stable tag: 2.0.5
8
 
9
  This plugin inserts social share links at the top or bottom of each post.
10
 
11
  == Description ==
12
 
13
- This plugin inserts social share links at the top or bottom of each post.
 
14
 
15
  This plugin documentation can be found [here](https://github.com/utahta/WP-Social-Bookmarking-Light/wiki).
16
 
@@ -51,6 +52,9 @@ This is the list of used social sites:
51
 
52
  == Changelog ==
53
 
 
 
 
54
  = 2.0.5 =
55
  * Added: wsbl_embed shortcode [#56](https://github.com/utahta/WP-Social-Bookmarking-Light/pull/56)
56
 
4
  Tags: social, bookmarks, bookmarking, Hatena, Twitter, Facebook, Tumblr, Google Bookmark, Delicious, Digg, reddit, LinkedIn, Instapaper, StumbleUpon, mixi, gree, atode, toread, line, pocket, Pinterest
5
  Requires at least: 4.0.0
6
  Tested up to: 4.7
7
+ Stable tag: 2.0.6
8
 
9
  This plugin inserts social share links at the top or bottom of each post.
10
 
11
  == Description ==
12
 
13
+ This plugin inserts social share links at the top or bottom of each post.
14
+ For theme developers, social share links can be added by PHP code or by using shortcode. Check documentation for this use-case.
15
 
16
  This plugin documentation can be found [here](https://github.com/utahta/WP-Social-Bookmarking-Light/wiki).
17
 
52
 
53
  == Changelog ==
54
 
55
+ = 2.0.6 =
56
+ * Fixed: pinterest behavior [#59](https://github.com/utahta/WP-Social-Bookmarking-Light/pull/59)
57
+
58
  = 2.0.5 =
59
  * Added: wsbl_embed shortcode [#56](https://github.com/utahta/WP-Social-Bookmarking-Light/pull/56)
60
 
src/WpSocialBookmarkingLight/Option.php CHANGED
@@ -124,7 +124,6 @@ class Option implements OptionInterface
124
  'type' => $data['pinterest_type'],
125
  'shape' => $data['pinterest_shape'],
126
  'size' => $data['pinterest_size'],
127
- 'color' => $data['pinterest_color'],
128
  'lang' => $data['pinterest_lang'],
129
  ),
130
  );
@@ -243,10 +242,9 @@ CSS;
243
  ),
244
  'pocket' => array('button_type' => 'none'),
245
  'pinterest' => array(
246
- 'type' => 'all',
247
  'shape' => 'rect',
248
  'size' => 'small',
249
- 'color' => 'gray',
250
  'lang' => 'en',
251
  ),
252
  );
124
  'type' => $data['pinterest_type'],
125
  'shape' => $data['pinterest_shape'],
126
  'size' => $data['pinterest_size'],
 
127
  'lang' => $data['pinterest_lang'],
128
  ),
129
  );
242
  ),
243
  'pocket' => array('button_type' => 'none'),
244
  'pinterest' => array(
245
+ 'type' => 'any',
246
  'shape' => 'rect',
247
  'size' => 'small',
 
248
  'lang' => 'en',
249
  ),
250
  );
src/WpSocialBookmarkingLight/Resources/views/Admin/page.html.twig CHANGED
@@ -603,8 +603,9 @@
603
  <th scope="row">Type: <br> <span style="font-size:10px"></span></th>
604
  <td>
605
  <select name='pinterest_type'>
606
- <option value='all' {{ option.pinterest.type == 'all' ? 'selected' : '' }}>All</option>
607
- <option value='hover' {{ option.pinterest.type == 'hover' ? 'selected' : '' }}>Hover</option>
 
608
  </select>
609
  </td>
610
  </tr>
@@ -626,16 +627,6 @@
626
  </select>
627
  </td>
628
  </tr>
629
- <tr>
630
- <th scope="row">Color: <br> <span style="font-size:10px"></span></th>
631
- <td>
632
- <select name='pinterest_color'>
633
- <option value='red' {{ option.pinterest.color == 'red' ? 'selected' : '' }}>Red</option>
634
- <option value='gray' {{ option.pinterest.color == 'gray' ? 'selected' : '' }}>Gray</option>
635
- <option value='white' {{ option.pinterest.color == 'white' ? 'selected' : '' }}>White</option>
636
- </select>
637
- </td>
638
- </tr>
639
  <tr>
640
  <th scope="row">Language:</th>
641
  <td>
603
  <th scope="row">Type: <br> <span style="font-size:10px"></span></th>
604
  <td>
605
  <select name='pinterest_type'>
606
+ <option value='all' {{ option.pinterest.type == 'all' ? 'selected' : '' }}>Any Image & Hover</option>
607
+ <option value='any' {{ option.pinterest.type == 'any' ? 'selected' : '' }}>Any Image</option>
608
+ <option value='hover' {{ option.pinterest.type == 'hover' ? 'selected' : '' }}>Image Hover</option>
609
  </select>
610
  </td>
611
  </tr>
627
  </select>
628
  </td>
629
  </tr>
 
 
 
 
 
 
 
 
 
 
630
  <tr>
631
  <th scope="row">Language:</th>
632
  <td>
src/WpSocialBookmarkingLight/Resources/views/Builder/footer.html.twig CHANGED
@@ -11,20 +11,16 @@
11
  {% endif %}
12
 
13
  {% if pinterest %}
14
- {% set data_pin_shape = pinterest.shape == 'round' ? 'data-pin-shape=true' : '' %}
15
-
16
- {% if pinterest.size == 'large' %}
17
- {% set data_pin_height = pinterest.shape == 'round' ? 'data-pin-height="32"' : 'data-pin-height="28"' %}
18
- {% else %}
19
- {% set data_pin_height = '' %}
20
- {% endif %}
21
 
22
  <script type="text/javascript" async defer
23
- data-pin-hover=true
24
- {{ data_pin_shape }}
25
- data-pin-color="{{ pinterest.color }}"
26
- data-pin-lang="{{ pinterest.lang }}"
27
- {{ data_pin_height | raw }}
28
  src="//assets.pinterest.com/js/pinit.js"></script>
29
  {% endif %}
30
  <!-- END: WP Social Bookmarking Light FOOTER -->
11
  {% endif %}
12
 
13
  {% if pinterest %}
14
+ {% set data_pin_hover = pinterest.type == 'all' or pinterest.type == 'hover' ? 'data-pin-hover="true"' : '' %}
15
+ {% set data_pin_round = pinterest.shape == 'round' ? 'data-pin-round="true"' : '' %}
16
+ {% set data_pin_lang = pinterest.lang != '' ? 'data-pin-lang="'+pinterest.lang+'"' : '' %}
17
+ {% set data_pin_tall = pinterest.size == 'large' ? 'data-pin-tall="true"' : '' %}
 
 
 
18
 
19
  <script type="text/javascript" async defer
20
+ {{ data_pin_hover }}
21
+ {{ data_pin_round }}
22
+ {{ data_pin_lang }}
23
+ {{ data_pin_tall }}
 
24
  src="//assets.pinterest.com/js/pinit.js"></script>
25
  {% endif %}
26
  <!-- END: WP Social Bookmarking Light FOOTER -->
src/WpSocialBookmarkingLight/Service.php CHANGED
@@ -646,46 +646,40 @@ class Service
646
  if ($pinterest['type'] === 'hover') {
647
  return '';
648
  }
649
- $data_pin_shape = '';
650
- $data_pin_color = '';
651
  $data_pin_lang = '';
 
652
 
653
  if ($pinterest['shape'] === 'round') {
654
- // 円形ボタン
655
- $data_pin_shape = 'data-pin-shape="round"';
656
 
657
  if ($pinterest['size'] === 'large') {
658
- $data_pin_height = 'data-pin-height="32"';
659
- $img_src = "//assets.pinterest.com/images/pidgets/pinit_fg_en_round_red_32.png";
660
  } else {
661
- $data_pin_height = '';
662
- $img_src = '//assets.pinterest.com/images/pidgets/pinit_fg_en_round_red_16.png';
663
  }
664
  } else {
665
- // 長方形ボタン
666
- $color = $pinterest['color'];
667
- $lang = $pinterest['lang'];
668
- $data_pin_color = 'data-pin-color="' . $color . '"';
669
- $data_pin_lang = 'data-pin-lang="' . $lang . '"';
670
 
671
  if ($pinterest['size'] === 'large') {
672
- $data_pin_height = 'data-pin-height="28"';
673
- $img_src = "//assets.pinterest.com/images/pidgets/pinit_fg_${lang}_rect_${color}_28.png";
674
- } else {
675
- $data_pin_height = '';
676
- $img_src = "//assets.pinterest.com/images/pidgets/pinit_fg_${lang}_round_${$color}_16.png";
677
  }
678
  }
679
 
680
  return $this->linkRaw(
681
- '<a href="//jp.pinterest.com/pin/create/button/"'
682
  . ' data-pin-do="buttonBookmark"'
683
- . ' ' . $data_pin_color
684
  . ' ' . $data_pin_lang
685
- . ' ' . $data_pin_shape
686
- . ' ' . $data_pin_height
687
  . '>'
688
- . '<img src="' . $img_src . '" /></a>'
 
689
  );
690
  }
691
  }
646
  if ($pinterest['type'] === 'hover') {
647
  return '';
648
  }
649
+ $data_pin_round = '';
650
+ $data_pin_tall = '';
651
  $data_pin_lang = '';
652
+ $img = '';
653
 
654
  if ($pinterest['shape'] === 'round') {
655
+ $data_pin_round = 'data-pin-round="true"';
 
656
 
657
  if ($pinterest['size'] === 'large') {
658
+ $data_pin_tall = 'data-pin-tall="true"';
659
+ $img = "<img src='//assets.pinterest.com/images/pidgets/pinit_fg_en_round_red_32.png' />";
660
  } else {
661
+ $img = "<img src='//assets.pinterest.com/images/pidgets/pinit_fg_en_round_red_16.png' />";
 
662
  }
663
  } else {
664
+ // rectangle button
665
+ if ($pinterest['lang'] !== '') {
666
+ $data_pin_lang = 'data-pin-lang="' . $pinterest['lang'] . '"';
667
+ }
 
668
 
669
  if ($pinterest['size'] === 'large') {
670
+ $data_pin_tall = 'data-pin-tall="true"';
 
 
 
 
671
  }
672
  }
673
 
674
  return $this->linkRaw(
675
+ '<a href="//www.pinterest.com/pin/create/button/"'
676
  . ' data-pin-do="buttonBookmark"'
 
677
  . ' ' . $data_pin_lang
678
+ . ' ' . $data_pin_tall
679
+ . ' ' . $data_pin_round
680
  . '>'
681
+ . $img
682
+ . '</a>'
683
  );
684
  }
685
  }
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInita01aefdde14df781d747d40ed9622518::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitf2179522563cb16eead252839f47c79a::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInita01aefdde14df781d747d40ed9622518
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInita01aefdde14df781d747d40ed9622518
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInita01aefdde14df781d747d40ed9622518', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInita01aefdde14df781d747d40ed9622518', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInita01aefdde14df781d747d40ed9622518::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitf2179522563cb16eead252839f47c79a
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitf2179522563cb16eead252839f47c79a', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitf2179522563cb16eead252839f47c79a', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInitf2179522563cb16eead252839f47c79a::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInita01aefdde14df781d747d40ed9622518
8
  {
9
  public static $fallbackDirsPsr4 = array (
10
  0 => __DIR__ . '/../..' . '/src',
@@ -23,8 +23,8 @@ class ComposerStaticInita01aefdde14df781d747d40ed9622518
23
  public static function getInitializer(ClassLoader $loader)
24
  {
25
  return \Closure::bind(function () use ($loader) {
26
- $loader->fallbackDirsPsr4 = ComposerStaticInita01aefdde14df781d747d40ed9622518::$fallbackDirsPsr4;
27
- $loader->prefixesPsr0 = ComposerStaticInita01aefdde14df781d747d40ed9622518::$prefixesPsr0;
28
 
29
  }, null, ClassLoader::class);
30
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitf2179522563cb16eead252839f47c79a
8
  {
9
  public static $fallbackDirsPsr4 = array (
10
  0 => __DIR__ . '/../..' . '/src',
23
  public static function getInitializer(ClassLoader $loader)
24
  {
25
  return \Closure::bind(function () use ($loader) {
26
+ $loader->fallbackDirsPsr4 = ComposerStaticInitf2179522563cb16eead252839f47c79a::$fallbackDirsPsr4;
27
+ $loader->prefixesPsr0 = ComposerStaticInitf2179522563cb16eead252839f47c79a::$prefixesPsr0;
28
 
29
  }, null, ClassLoader::class);
30
  }
wp-social-bookmarking-light.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://github.com/utahta/WP-Social-Bookmarking-Light
5
  Description: This plugin inserts social share links at the top or bottom of each post.
6
  Author: utahta
7
  Author URI: https://github.com/utahta/WP-Social-Bookmarking-Light
8
- Version: 2.0.5
9
  */
10
  /*
11
  Copyright 2010 utahta (email : labs.ninxit@gmail.com)
5
  Description: This plugin inserts social share links at the top or bottom of each post.
6
  Author: utahta
7
  Author URI: https://github.com/utahta/WP-Social-Bookmarking-Light
8
+ Version: 2.0.6
9
  */
10
  /*
11
  Copyright 2010 utahta (email : labs.ninxit@gmail.com)