Storefront Product Sharing - Version 1.0.6

Version Description

  • 05.06.2018 =
  • Fix - Compatibility with Storefront 2.3.
Download this release

Release Info

Developer woothemes
Plugin Icon 128x128 Storefront Product Sharing
Version 1.0.6
Comparing to
See all releases

Code changes from version 1.0.5 to 1.0.6

assets/css/style.css CHANGED
@@ -20,15 +20,33 @@
20
  .storefront-product-sharing ul li.email a:before {
21
  content: "\f199"; }
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  @media screen and (min-width: 768px) {
24
  .storefront-product-sharing {
25
  padding: 1.618em 0; }
26
  .storefront-product-sharing ul {
27
  margin: 0; }
28
- .storefront-product-sharing ul::after {
29
- clear: both;
30
- content: "";
31
  display: table; }
 
 
32
  .storefront-product-sharing ul li {
33
  width: 25%;
34
  float: left;
@@ -42,12 +60,6 @@
42
  display: block;
43
  margin: 0 auto .007em;
44
  font-size: 2.618em;
45
- -webkit-transition: all, ease, 0.2s;
46
- -moz-transition: all, ease, 0.2s;
47
- transition: all, ease, 0.2s; }
48
  .storefront-product-sharing ul li a:hover:before {
49
- -webkit-transform: translateY(-0.236em);
50
- -moz-transform: translateY(-0.236em);
51
- -ms-transform: translateY(-0.236em);
52
- -o-transform: translateY(-0.236em);
53
  transform: translateY(-0.236em); } }
20
  .storefront-product-sharing ul li.email a:before {
21
  content: "\f199"; }
22
 
23
+ .storefront-2-3 .storefront-product-sharing ul li a:before {
24
+ font-family: "Font Awesome 5 Brands"; }
25
+
26
+ .storefront-2-3 .storefront-product-sharing ul li.facebook a:before {
27
+ content: "\f09a"; }
28
+
29
+ .storefront-2-3 .storefront-product-sharing ul li.twitter a:before {
30
+ content: "\f099"; }
31
+
32
+ .storefront-2-3 .storefront-product-sharing ul li.pinterest a:before {
33
+ content: "\f0d2"; }
34
+
35
+ .storefront-2-3 .storefront-product-sharing ul li.email a:before {
36
+ font-weight: 900;
37
+ font-family: "Font Awesome 5 Free";
38
+ content: "\f0e0"; }
39
+
40
  @media screen and (min-width: 768px) {
41
  .storefront-product-sharing {
42
  padding: 1.618em 0; }
43
  .storefront-product-sharing ul {
44
  margin: 0; }
45
+ .storefront-product-sharing ul::before, .storefront-product-sharing ul::after {
46
+ content: '';
 
47
  display: table; }
48
+ .storefront-product-sharing ul::after {
49
+ clear: both; }
50
  .storefront-product-sharing ul li {
51
  width: 25%;
52
  float: left;
60
  display: block;
61
  margin: 0 auto .007em;
62
  font-size: 2.618em;
63
+ transition: all, ease, .2s; }
 
 
64
  .storefront-product-sharing ul li a:hover:before {
 
 
 
 
65
  transform: translateY(-0.236em); } }
assets/css/style.scss CHANGED
@@ -1,6 +1,6 @@
1
- @import 'susy';
2
- @import 'bourbon';
3
- @import '../../../../themes/storefront/assets/sass/utils/variables';
4
 
5
  // Styles for mobile
6
  .storefront-product-sharing {
@@ -48,6 +48,44 @@
48
  }
49
  }
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  @media screen and (min-width: 768px) {
52
 
53
  // Styles for desktop
@@ -75,12 +113,12 @@
75
  display: block;
76
  margin: 0 auto .007em;
77
  font-size: 2.618em;
78
- @include transition(all,ease,.2s);
79
  }
80
 
81
  &:hover {
82
  &:before {
83
- @include transform(translateY(-.236em));
84
  }
85
  }
86
  }
1
+ @import '../../../../themes/storefront/assets/css/sass/utils/mixins';
2
+ @import '../../../../themes/storefront/assets/css/sass/utils/variables';
3
+ @import '../../../../themes/storefront/assets/css/sass/vendors/font-awesome/variables';
4
 
5
  // Styles for mobile
6
  .storefront-product-sharing {
48
  }
49
  }
50
 
51
+ .storefront-2-3 {
52
+ .storefront-product-sharing {
53
+ ul {
54
+ li {
55
+ a:before {
56
+ font-family: "Font Awesome 5 Brands";
57
+ }
58
+
59
+ &.facebook {
60
+ a:before {
61
+ content: fa-content( $fa-var-facebook );
62
+ }
63
+ }
64
+
65
+ &.twitter {
66
+ a:before {
67
+ content: fa-content( $fa-var-twitter );
68
+ }
69
+ }
70
+
71
+ &.pinterest {
72
+ a:before {
73
+ content: fa-content( $fa-var-pinterest );
74
+ }
75
+ }
76
+
77
+ &.email {
78
+ a:before {
79
+ font-weight: 900;
80
+ font-family: "Font Awesome 5 Free";
81
+ content: fa-content( $fa-var-envelope );
82
+ }
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
88
+
89
  @media screen and (min-width: 768px) {
90
 
91
  // Styles for desktop
113
  display: block;
114
  margin: 0 auto .007em;
115
  font-size: 2.618em;
116
+ transition: all, ease, .2s;
117
  }
118
 
119
  &:hover {
120
  &:before {
121
+ transform: translateY(-.236em);
122
  }
123
  }
124
  }
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: jameskoster, woothemes, tiagonoronha
3
  Tags: woocommerce, ecommerce, storefront, social, sharing, seo
4
  Requires at least: 3.5
5
- Tested up to: 4.8
6
- Stable tag: 1.0.5
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -33,6 +33,9 @@ This plugin will only work with the [Storefront](http://wordpress.org/themes/sto
33
 
34
  == Changelog ==
35
 
 
 
 
36
  = 1.0.5 - 04.19.2018 =
37
  * Tweak - Add `noopener noreferrer` to social media links.
38
 
2
  Contributors: jameskoster, woothemes, tiagonoronha
3
  Tags: woocommerce, ecommerce, storefront, social, sharing, seo
4
  Requires at least: 3.5
5
+ Tested up to: 4.9
6
+ Stable tag: 1.0.6
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
33
 
34
  == Changelog ==
35
 
36
+ = 1.0.6 - 05.06.2018 =
37
+ * Fix - Compatibility with Storefront 2.3.
38
+
39
  = 1.0.5 - 04.19.2018 =
40
  * Tweak - Add `noopener noreferrer` to social media links.
41
 
storefront-product-sharing.php CHANGED
@@ -3,11 +3,11 @@
3
  * Plugin Name: Storefront Product Sharing
4
  * Plugin URI: https://woocommerce.com/products/storefront-product-sharing/
5
  * Description: Add attractive social sharing icons for Facebook, Twitter, Pinterest and Email to your product pages.
6
- * Version: 1.0.5
7
  * Author: WooCommerce
8
  * Author URI: https://woocommerce.com/
9
  * Requires at least: 4.0.0
10
- * Tested up to: 4.9.4
11
  *
12
  * Text Domain: storefront-product-sharing
13
  * Domain Path: /languages/
@@ -84,7 +84,7 @@ final class Storefront_Product_Sharing {
84
  $this->token = 'storefront-product-sharing';
85
  $this->plugin_url = plugin_dir_url( __FILE__ );
86
  $this->plugin_path = plugin_dir_path( __FILE__ );
87
- $this->version = '1.0.5';
88
 
89
  register_activation_hook( __FILE__, array( $this, 'install' ) );
90
 
@@ -171,6 +171,7 @@ final class Storefront_Product_Sharing {
171
  if ( 'Storefront' == $theme->name || 'storefront' == $theme->template && apply_filters( 'storefront_extension_boilerplate_supported', true ) ) {
172
  add_action( 'wp_enqueue_scripts', array( $this, 'sps_styles' ), 999 );
173
  add_action( 'woocommerce_after_single_product_summary', array( $this, 'sps_product_sharing' ), 5 );
 
174
 
175
  // Hide the 'More' section in the customizer
176
  add_filter( 'storefront_customizer_more', '__return_false' );
@@ -179,6 +180,23 @@ final class Storefront_Product_Sharing {
179
  }
180
  }
181
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
  /**
183
  * Storefront install
184
  * If the user activates the plugin while having a different parent theme active, prompt them to install Storefront.
@@ -197,6 +215,12 @@ final class Storefront_Product_Sharing {
197
  * @return void
198
  */
199
  public function sps_styles() {
 
 
 
 
 
 
200
  wp_enqueue_style( 'sps-styles', plugins_url( '/assets/css/style.css', __FILE__ ) );
201
  }
202
 
3
  * Plugin Name: Storefront Product Sharing
4
  * Plugin URI: https://woocommerce.com/products/storefront-product-sharing/
5
  * Description: Add attractive social sharing icons for Facebook, Twitter, Pinterest and Email to your product pages.
6
+ * Version: 1.0.6
7
  * Author: WooCommerce
8
  * Author URI: https://woocommerce.com/
9
  * Requires at least: 4.0.0
10
+ * Tested up to: 4.9
11
  *
12
  * Text Domain: storefront-product-sharing
13
  * Domain Path: /languages/
84
  $this->token = 'storefront-product-sharing';
85
  $this->plugin_url = plugin_dir_url( __FILE__ );
86
  $this->plugin_path = plugin_dir_path( __FILE__ );
87
+ $this->version = '1.0.6';
88
 
89
  register_activation_hook( __FILE__, array( $this, 'install' ) );
90
 
171
  if ( 'Storefront' == $theme->name || 'storefront' == $theme->template && apply_filters( 'storefront_extension_boilerplate_supported', true ) ) {
172
  add_action( 'wp_enqueue_scripts', array( $this, 'sps_styles' ), 999 );
173
  add_action( 'woocommerce_after_single_product_summary', array( $this, 'sps_product_sharing' ), 5 );
174
+ add_filter( 'body_class', array( $this, 'body_classes' ) );
175
 
176
  // Hide the 'More' section in the customizer
177
  add_filter( 'storefront_customizer_more', '__return_false' );
180
  }
181
  }
182
 
183
+ /**
184
+ * Adds custom classes to the array of body classes.
185
+ *
186
+ * @since 1.0.6
187
+ * @param array $classes Classes for the body element.
188
+ * @return array
189
+ */
190
+ public function body_classes( $classes ) {
191
+ global $storefront_version;
192
+
193
+ if ( version_compare( $storefront_version, '2.3.0', '>=' ) ) {
194
+ $classes[] = 'storefront-2-3';
195
+ }
196
+
197
+ return $classes;
198
+ }
199
+
200
  /**
201
  * Storefront install
202
  * If the user activates the plugin while having a different parent theme active, prompt them to install Storefront.
215
  * @return void
216
  */
217
  public function sps_styles() {
218
+ global $storefront_version;
219
+
220
+ if ( version_compare( $storefront_version, '2.3.0', '>=' ) ) {
221
+ wp_enqueue_style( 'font-awesome-5-brands', '//use.fontawesome.com/releases/v5.0.13/css/brands.css' );
222
+ }
223
+
224
  wp_enqueue_style( 'sps-styles', plugins_url( '/assets/css/style.css', __FILE__ ) );
225
  }
226