AddToAny Share Buttons - Version 1.7.38

Version Description

  • Update AMP support for compatibility with AMP's standard mode
Download this release

Release Info

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

Code changes from version 1.7.37 to 1.7.38

Files changed (3) hide show
  1. README.txt +6 -3
  2. add-to-any.php +5 -12
  3. addtoany.compat.php +0 -5
README.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: micropat, addtoany
3
  Tags: buttons, share, icons, social media, share buttons, sharing, share button, media, social, marketing, links, email, seo, woocommerce, google, linkedin, reddit, facebook, twitter, pinterest, whatsapp, instagram, youtube, share this, sharethis, feed
4
  Requires at least: 3.7
5
- Tested up to: 5.2
6
  Requires PHP: 5.2
7
- Stable tag: 1.7.37
8
 
9
  Share buttons for WordPress including the AddToAny sharing button, Facebook, Twitter, WhatsApp, Pinterest, Reddit, many more, and follow icons too.
10
 
@@ -346,6 +346,9 @@ Upload (or move) the `add-to-any` plugin directory into the `/wp-content/mu-plug
346
 
347
  == Changelog ==
348
 
 
 
 
349
  = 1.7.37 =
350
  * Harden option to toggle standard sharing placement on pages and the "page" post type
351
 
@@ -353,7 +356,7 @@ Upload (or move) the `add-to-any` plugin directory into the `/wp-content/mu-plug
353
  * Apply the "Show sharing buttons" option to the floating vertical bar when Placement is set to "Attach to content"
354
 
355
  = 1.7.35 =
356
- * Remove Google+ because Google is [shut down Google+](https://support.google.com/plus/answer/9195133)
357
 
358
  = 1.7.34 =
359
  * Add MeWe
2
  Contributors: micropat, addtoany
3
  Tags: buttons, share, icons, social media, share buttons, sharing, share button, media, social, marketing, links, email, seo, woocommerce, google, linkedin, reddit, facebook, twitter, pinterest, whatsapp, instagram, youtube, share this, sharethis, feed
4
  Requires at least: 3.7
5
+ Tested up to: 5.3
6
  Requires PHP: 5.2
7
+ Stable tag: 1.7.38
8
 
9
  Share buttons for WordPress including the AddToAny sharing button, Facebook, Twitter, WhatsApp, Pinterest, Reddit, many more, and follow icons too.
10
 
346
 
347
  == Changelog ==
348
 
349
+ = 1.7.38 =
350
+ * Update AMP support for compatibility with AMP's standard mode
351
+
352
  = 1.7.37 =
353
  * Harden option to toggle standard sharing placement on pages and the "page" post type
354
 
356
  * Apply the "Show sharing buttons" option to the floating vertical bar when Placement is set to "Attach to content"
357
 
358
  = 1.7.35 =
359
+ * Remove Google+ because Google [shut down Google+](https://support.google.com/plus/answer/9195133)
360
 
361
  = 1.7.34 =
362
  * Add MeWe
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.37
7
  Author: AddToAny
8
  Author URI: https://www.addtoany.com/
9
  Text Domain: add-to-any
@@ -13,7 +13,7 @@ Domain Path: /languages
13
  // Explicitly globalize to support bootstrapped WordPress
14
  global $A2A_locale, $A2A_FOLLOW_services,
15
  $A2A_SHARE_SAVE_options, $A2A_SHARE_SAVE_plugin_dir, $A2A_SHARE_SAVE_plugin_url,
16
- $A2A_SHARE_SAVE_services, $A2A_SHARE_SAVE_amp_icons_css;
17
 
18
  $A2A_SHARE_SAVE_plugin_dir = untrailingslashit( plugin_dir_path( __FILE__ ) );
19
  $A2A_SHARE_SAVE_plugin_url = untrailingslashit( plugin_dir_url( __FILE__ ) );
@@ -184,8 +184,7 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
184
  // $args array: output_later, html_container_open, html_container_close, html_wrap_open, html_wrap_close, linkname, linkurl
185
 
186
  global $A2A_SHARE_SAVE_services,
187
- $A2A_FOLLOW_services,
188
- $A2A_SHARE_SAVE_amp_icons_css;
189
 
190
  $options = get_option( 'addtoany_options', array() );
191
 
@@ -213,7 +212,6 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
213
  $args = wp_parse_args( $args, $defaults );
214
 
215
  $is_amp = function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ? true : false;
216
- $amp_css = '.a2a_dd img{background-color:#0166FF;}';
217
 
218
  // Large icons except for AMP endpoint
219
  $large_icons = $is_amp ? false : true;
@@ -326,7 +324,7 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
326
  $height_attr = isset( $service['icon_height'] ) ? ' height="' . esc_attr( $service['icon_height'] ) . '"' : ' height="16"';
327
  $height_attr = $is_amp && ! empty( $args['icon_size'] ) ? ' height="' . esc_attr( $args['icon_size'] ) . '"' : $height_attr;
328
 
329
- $amp_css .= $is_amp && ! empty( $service['color'] ) ? '.a2a_button_' . esc_attr( $code_name ) . ' img{background-color:#' . $service['color'] . ';}' : '';
330
 
331
  $url = isset( $href ) ? $href : 'https://www.addtoany.com/add_to/' . $code_name . '?linkurl=' . $args['linkurl_enc'] .'&linkname=' . $args['linkname_enc'];
332
  $src = $icon_url ? $icon_url : $icons_dir . $icon . '.' . $icons_type;
@@ -356,7 +354,7 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
356
  }
357
 
358
  $link = $args['html_wrap_open'] . "<a$class_attr$href_attr$title_attr$rel_attr$target_attr>";
359
- $link .= ( $large_icons && ! isset( $custom_icons ) && ! $custom_service ) ? '' : '<img src="' . esc_attr( $src ) . '"' . $width_attr . $height_attr . ' alt="' . esc_attr( $name ) . '">';
360
  $link .= "</a>" . $args['html_wrap_close'];
361
  }
362
 
@@ -365,11 +363,6 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
365
 
366
  $ind_html .= $args['html_container_close'];
367
 
368
- if ( $is_amp ) {
369
- $A2A_SHARE_SAVE_amp_icons_css = $amp_css;
370
- add_action( 'amp_post_template_css', 'addtoany_amp_icons_css' );
371
- }
372
-
373
  if ( true == $args['output_later'] )
374
  return $ind_html;
375
  else
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.38
7
  Author: AddToAny
8
  Author URI: https://www.addtoany.com/
9
  Text Domain: add-to-any
13
  // Explicitly globalize to support bootstrapped WordPress
14
  global $A2A_locale, $A2A_FOLLOW_services,
15
  $A2A_SHARE_SAVE_options, $A2A_SHARE_SAVE_plugin_dir, $A2A_SHARE_SAVE_plugin_url,
16
+ $A2A_SHARE_SAVE_services;
17
 
18
  $A2A_SHARE_SAVE_plugin_dir = untrailingslashit( plugin_dir_path( __FILE__ ) );
19
  $A2A_SHARE_SAVE_plugin_url = untrailingslashit( plugin_dir_url( __FILE__ ) );
184
  // $args array: output_later, html_container_open, html_container_close, html_wrap_open, html_wrap_close, linkname, linkurl
185
 
186
  global $A2A_SHARE_SAVE_services,
187
+ $A2A_FOLLOW_services;
 
188
 
189
  $options = get_option( 'addtoany_options', array() );
190
 
212
  $args = wp_parse_args( $args, $defaults );
213
 
214
  $is_amp = function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ? true : false;
 
215
 
216
  // Large icons except for AMP endpoint
217
  $large_icons = $is_amp ? false : true;
324
  $height_attr = isset( $service['icon_height'] ) ? ' height="' . esc_attr( $service['icon_height'] ) . '"' : ' height="16"';
325
  $height_attr = $is_amp && ! empty( $args['icon_size'] ) ? ' height="' . esc_attr( $args['icon_size'] ) . '"' : $height_attr;
326
 
327
+ $img_style_attr = $is_amp && ! empty( $service['color'] ) ? ' style="background-color:#' . esc_attr( $service['color'] ) . ';"' : '';
328
 
329
  $url = isset( $href ) ? $href : 'https://www.addtoany.com/add_to/' . $code_name . '?linkurl=' . $args['linkurl_enc'] .'&amp;linkname=' . $args['linkname_enc'];
330
  $src = $icon_url ? $icon_url : $icons_dir . $icon . '.' . $icons_type;
354
  }
355
 
356
  $link = $args['html_wrap_open'] . "<a$class_attr$href_attr$title_attr$rel_attr$target_attr>";
357
+ $link .= ( $large_icons && ! isset( $custom_icons ) && ! $custom_service ) ? '' : '<img' . $img_style_attr . ' src="' . esc_attr( $src ) . '"' . $width_attr . $height_attr . ' alt="' . esc_attr( $name ) . '">';
358
  $link .= "</a>" . $args['html_wrap_close'];
359
  }
360
 
363
 
364
  $ind_html .= $args['html_container_close'];
365
 
 
 
 
 
 
366
  if ( true == $args['output_later'] )
367
  return $ind_html;
368
  else
addtoany.compat.php CHANGED
@@ -39,11 +39,6 @@ function addtoany_amp_additional_css_styles( $amp_template ) {
39
  <?php
40
  }
41
 
42
- function addtoany_amp_icons_css( $amp_template ) {
43
- global $A2A_SHARE_SAVE_amp_icons_css;
44
- echo $A2A_SHARE_SAVE_amp_icons_css;
45
- }
46
-
47
  /**
48
  * Move buttons from WooCommerce product description to WooCommerce's sharing block
49
  */
39
  <?php
40
  }
41
 
 
 
 
 
 
42
  /**
43
  * Move buttons from WooCommerce product description to WooCommerce's sharing block
44
  */