AddToAny Share Buttons - Version 1.7.7

Version Description

  • Resolve syntax issue with out-of-date PHP versions below PHP 5.3
Download this release

Release Info

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

Code changes from version 1.7.6 to 1.7.7

Files changed (3) hide show
  1. README.txt +5 -2
  2. add-to-any.php +9 -12
  3. addtoany.compat.php +5 -0
README.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: micropat, addtoany
3
  Tags: AddToAny, share, sharing, social, share button, share buttons, social media, media, marketing, links, email, seo, woocommerce, ecommerce, google, linkedin, reddit, facebook, like, twitter, pinterest, whatsapp, instagram, youtube, addthis, share this, sharethis, feed, icons
4
  Requires at least: 3.7
5
  Tested up to: 4.7
6
- Stable tag: 1.7.6
7
 
8
  Share buttons for WordPress including the AddToAny sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp, many more, and follow icons too.
9
 
@@ -334,8 +334,11 @@ Upload (or move) the `add-to-any` plugin directory into the `/wp-content/mu-plug
334
 
335
  == Changelog ==
336
 
 
 
 
337
  = 1.7.6 =
338
- * Skip background colors on AMP for [out-of-date PHP versions](https://secure.php.net/eol.php) below PHP 5.3
339
 
340
  = 1.7.5 =
341
  * Add background colors to share buttons on [AMP](https://wordpress.org/plugins/amp/) (Accelerated Mobile Pages) to support new AddToAny SVG icons
3
  Tags: AddToAny, share, sharing, social, share button, share buttons, social media, media, marketing, links, email, seo, woocommerce, ecommerce, google, linkedin, reddit, facebook, like, twitter, pinterest, whatsapp, instagram, youtube, addthis, share this, sharethis, feed, icons
4
  Requires at least: 3.7
5
  Tested up to: 4.7
6
+ Stable tag: 1.7.7
7
 
8
  Share buttons for WordPress including the AddToAny sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp, many more, and follow icons too.
9
 
334
 
335
  == Changelog ==
336
 
337
+ = 1.7.7 =
338
+ * Resolve syntax issue with [out-of-date PHP versions](https://secure.php.net/eol.php) below PHP 5.3
339
+
340
  = 1.7.6 =
341
+ * Skip background colors on AMP icons for [out-of-date PHP versions](https://secure.php.net/eol.php) below PHP 5.3
342
 
343
  = 1.7.5 =
344
  * Add background colors to share buttons on [AMP](https://wordpress.org/plugins/amp/) (Accelerated Mobile Pages) to support new AddToAny SVG icons
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.6
7
  Author: AddToAny
8
  Author URI: https://www.addtoany.com/
9
  Text Domain: add-to-any
@@ -12,7 +12,8 @@ Domain Path: /languages
12
 
13
  // Explicitly globalize to support bootstrapped WordPress
14
  global $A2A_locale, $A2A_FOLLOW_services,
15
- $A2A_SHARE_SAVE_plugin_basename, $A2A_SHARE_SAVE_options, $A2A_SHARE_SAVE_plugin_dir, $A2A_SHARE_SAVE_plugin_url_path, $A2A_SHARE_SAVE_services;
 
16
 
17
  $A2A_SHARE_SAVE_plugin_basename = plugin_basename( dirname( __FILE__ ) );
18
  $A2A_SHARE_SAVE_plugin_dir = untrailingslashit( plugin_dir_path( __FILE__ ) );
@@ -178,7 +179,8 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
178
 
179
  global $A2A_SHARE_SAVE_plugin_url_path,
180
  $A2A_SHARE_SAVE_services,
181
- $A2A_FOLLOW_services;
 
182
 
183
  $options = get_option( 'addtoany_options' );
184
 
@@ -211,7 +213,7 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
211
 
212
  $https_or_http = is_ssl() ? 'https' : 'http';
213
  $is_amp = function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ? true : false;
214
- $amp_css = '';
215
 
216
  // Large icons except for AMP endpoint
217
  $large_icons = $is_amp ? false : true;
@@ -351,8 +353,9 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
351
 
352
  $ind_html .= $html_container_close;
353
 
354
- if ( $is_amp && version_compare( PHP_VERSION, '5.3.0', '>=' ) ) {
355
- add_action( 'amp_post_template_css', function( $amp_template ) use ( $amp_css ) { echo $amp_css; } );
 
356
  }
357
 
358
  if ( true == $output_later )
@@ -401,7 +404,6 @@ function ADDTOANY_SHARE_SAVE_BUTTON( $args = array() ) {
401
 
402
  $is_feed = is_feed();
403
  $is_amp = function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ? true : false;
404
- $amp_css = '';
405
  $button_class = '';
406
  $button_data_media = $is_kit || empty( $linkmedia ) ? '' : ' data-a2a-media="' . $linkmedia . '"';
407
  $button_data_title = $is_kit || empty( $linkname ) ? '' : ' data-a2a-title="' . $linkname . '"';
@@ -421,7 +423,6 @@ function ADDTOANY_SHARE_SAVE_BUTTON( $args = array() ) {
421
  $button_src = 'https://static.addtoany.com/buttons/a2a.svg';
422
  $button_width = ! empty( $icon_size ) ? ' width="' . $icon_size .'"' : ' width="32"';
423
  $button_height = ! empty( $icon_size ) ? ' height="' . $icon_size .'"' : ' height="32"';
424
- $amp_css = '.a2a_dd img{background-color:#0166FF;}';
425
  } else {
426
  // Skip button IMG for A2A icon insertion
427
  $button_text = '';
@@ -483,10 +484,6 @@ function ADDTOANY_SHARE_SAVE_BUTTON( $args = array() ) {
483
  // Closing tags come after <script> to validate in case the container is a list element
484
  $button_html .= $html_wrap_close . $html_container_close;
485
 
486
- if ( $is_amp && version_compare( PHP_VERSION, '5.3.0', '>=' ) ) {
487
- add_action( 'amp_post_template_css', function( $amp_template ) use ( $amp_css ) { echo $amp_css; } );
488
- }
489
-
490
  if ( isset( $output_later ) && $output_later == true )
491
  return $button_html;
492
  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.7
7
  Author: AddToAny
8
  Author URI: https://www.addtoany.com/
9
  Text Domain: add-to-any
12
 
13
  // Explicitly globalize to support bootstrapped WordPress
14
  global $A2A_locale, $A2A_FOLLOW_services,
15
+ $A2A_SHARE_SAVE_plugin_basename, $A2A_SHARE_SAVE_options, $A2A_SHARE_SAVE_plugin_dir, $A2A_SHARE_SAVE_plugin_url_path,
16
+ $A2A_SHARE_SAVE_services, $A2A_SHARE_SAVE_amp_icons_css;
17
 
18
  $A2A_SHARE_SAVE_plugin_basename = plugin_basename( dirname( __FILE__ ) );
19
  $A2A_SHARE_SAVE_plugin_dir = untrailingslashit( plugin_dir_path( __FILE__ ) );
179
 
180
  global $A2A_SHARE_SAVE_plugin_url_path,
181
  $A2A_SHARE_SAVE_services,
182
+ $A2A_FOLLOW_services,
183
+ $A2A_SHARE_SAVE_amp_icons_css;
184
 
185
  $options = get_option( 'addtoany_options' );
186
 
213
 
214
  $https_or_http = is_ssl() ? 'https' : 'http';
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;
353
 
354
  $ind_html .= $html_container_close;
355
 
356
+ if ( $is_amp ) {
357
+ $A2A_SHARE_SAVE_amp_icons_css = $amp_css;
358
+ add_action( 'amp_post_template_css', 'addtoany_amp_icons_css' );
359
  }
360
 
361
  if ( true == $output_later )
404
 
405
  $is_feed = is_feed();
406
  $is_amp = function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ? true : false;
 
407
  $button_class = '';
408
  $button_data_media = $is_kit || empty( $linkmedia ) ? '' : ' data-a2a-media="' . $linkmedia . '"';
409
  $button_data_title = $is_kit || empty( $linkname ) ? '' : ' data-a2a-title="' . $linkname . '"';
423
  $button_src = 'https://static.addtoany.com/buttons/a2a.svg';
424
  $button_width = ! empty( $icon_size ) ? ' width="' . $icon_size .'"' : ' width="32"';
425
  $button_height = ! empty( $icon_size ) ? ' height="' . $icon_size .'"' : ' height="32"';
 
426
  } else {
427
  // Skip button IMG for A2A icon insertion
428
  $button_text = '';
484
  // Closing tags come after <script> to validate in case the container is a list element
485
  $button_html .= $html_wrap_close . $html_container_close;
486
 
 
 
 
 
487
  if ( isset( $output_later ) && $output_later == true )
488
  return $button_html;
489
  else
addtoany.compat.php CHANGED
@@ -37,4 +37,9 @@ function addtoany_amp_additional_css_styles( $amp_template ) {
37
  display: inline-block;
38
  }
39
  <?php
 
 
 
 
 
40
  }
37
  display: inline-block;
38
  }
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
  }