AddToAny Share Buttons - Version 1.7.14

Version Description

  • Fix the standard placement option for WooCommerce Product types
Download this release

Release Info

Developer micropat
Plugin Icon 128x128 AddToAny Share Buttons
Version 1.7.14
Comparing to
See all releases

Code changes from version 1.7.13 to 1.7.14

Files changed (3) hide show
  1. README.txt +4 -1
  2. add-to-any.php +1 -1
  3. addtoany.compat.php +21 -2
README.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: micropat, addtoany
3
  Tags: AddToAny, share, sharing, social, share buttons, share button, social media, media, marketing, links, email, seo, woocommerce, google, linkedin, reddit, facebook, like, twitter, pinterest, whatsapp, instagram, youtube, share this, sharethis, feed, icons
4
  Requires at least: 3.7
5
  Tested up to: 4.8
6
- Stable tag: 1.7.13
7
 
8
  Share buttons for WordPress including the AddToAny sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp, many more, and follow icons too.
9
 
@@ -349,6 +349,9 @@ Upload (or move) the `add-to-any` plugin directory into the `/wp-content/mu-plug
349
 
350
  == Changelog ==
351
 
 
 
 
352
  = 1.7.13 =
353
  * Update standard placement for [WooCommerce](https://woocommerce.com/) to display share buttons after the product meta block instead of the product description
354
  * In WooCommerce, you can customize where share buttons display by [editing](https://docs.woocommerce.com/document/editing-projects-templates-safely/) your `share.php` Single Product Share template.
3
  Tags: AddToAny, share, sharing, social, share buttons, share button, social media, media, marketing, links, email, seo, woocommerce, google, linkedin, reddit, facebook, like, twitter, pinterest, whatsapp, instagram, youtube, share this, sharethis, feed, icons
4
  Requires at least: 3.7
5
  Tested up to: 4.8
6
+ Stable tag: 1.7.14
7
 
8
  Share buttons for WordPress including the AddToAny sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp, many more, and follow icons too.
9
 
349
 
350
  == Changelog ==
351
 
352
+ = 1.7.14 =
353
+ * Fix the standard placement option for WooCommerce Product types
354
+
355
  = 1.7.13 =
356
  * Update standard placement for [WooCommerce](https://woocommerce.com/) to display share buttons after the product meta block instead of the product description
357
  * In WooCommerce, you can customize where share buttons display by [editing](https://docs.woocommerce.com/document/editing-projects-templates-safely/) your `share.php` Single Product Share template.
add-to-any.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: AddToAny Share Buttons
4
  Plugin URI: https://www.addtoany.com/
5
  Description: Share buttons for your pages including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp and many more.
6
- Version: 1.7.13
7
  Author: AddToAny
8
  Author URI: https://www.addtoany.com/
9
  Text Domain: add-to-any
3
  Plugin Name: AddToAny Share Buttons
4
  Plugin URI: https://www.addtoany.com/
5
  Description: Share buttons for your pages including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp and many more.
6
+ Version: 1.7.14
7
  Author: AddToAny
8
  Author URI: https://www.addtoany.com/
9
  Text Domain: add-to-any
addtoany.compat.php CHANGED
@@ -28,7 +28,7 @@ function addtoany_excerpt_remove() {
28
  add_action( 'amp_post_template_css', 'addtoany_amp_additional_css_styles' );
29
 
30
  function addtoany_amp_additional_css_styles( $amp_template ) {
31
- // only CSS here please...
32
  ?>
33
  .addtoany_list a {
34
  padding: 0 4px;
@@ -51,5 +51,24 @@ add_action( 'woocommerce_share', 'addtoany_woocommerce_share', 10 );
51
 
52
  function addtoany_woocommerce_share() {
53
  remove_filter( 'the_content', 'A2A_SHARE_SAVE_add_to_content', 98 );
54
- ADDTOANY_SHARE_SAVE_KIT();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  }
28
  add_action( 'amp_post_template_css', 'addtoany_amp_additional_css_styles' );
29
 
30
  function addtoany_amp_additional_css_styles( $amp_template ) {
31
+ // CSS only
32
  ?>
33
  .addtoany_list a {
34
  padding: 0 4px;
51
 
52
  function addtoany_woocommerce_share() {
53
  remove_filter( 'the_content', 'A2A_SHARE_SAVE_add_to_content', 98 );
54
+ remove_filter( 'the_excerpt', 'A2A_SHARE_SAVE_add_to_content', 98 );
55
+
56
+ $options = get_option( 'addtoany_options', array() );
57
+ $sharing_disabled = get_post_meta( get_the_ID(), 'sharing_disabled', true );
58
+ $sharing_disabled = apply_filters( 'addtoany_sharing_disabled', $sharing_disabled );
59
+ $post_type = get_post_type( get_the_ID() );
60
+
61
+ if (
62
+ // Private post
63
+ get_post_status( get_the_ID() ) == 'private' ||
64
+ // Sharing disabled on post
65
+ ! empty( $sharing_disabled ) ||
66
+ // Custom post type (usually "product") disabled
67
+ ( $post_type && isset( $options['display_in_cpt_' . $post_type] ) && $options['display_in_cpt_' . $post_type] == '-1' )
68
+ ) {
69
+ return;
70
+ } else {
71
+ // Display share buttons
72
+ ADDTOANY_SHARE_SAVE_KIT();
73
+ }
74
  }