AddToAny Share Buttons - Version 1.8.1

Version Description

  • Add Discord follow button
  • Add Snapchat share button
  • Fix AddToAny loading when a non-WordPress version of jQuery is used
Download this release

Release Info

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

Code changes from version 1.8.0 to 1.8.1

README.txt CHANGED
@@ -4,7 +4,7 @@ Tags: buttons, share, icons, social media, share buttons, sharing, share button,
4
  Requires at least: 4.5
5
  Tested up to: 5.8
6
  Requires PHP: 5.6
7
- Stable tag: 1.8.0
8
 
9
  Share buttons for WordPress including the AddToAny sharing button, Facebook, Twitter, WhatsApp, Pinterest, Reddit, many more, and follow icons too.
10
 
@@ -19,7 +19,7 @@ AddToAny is the home of universal sharing, and the AddToAny plugin is the most p
19
  * [**Standard**](https://www.addtoany.com/buttons/customize/wordpress/standalone_services) share buttons — share each piece of content
20
  * [**Floating**](https://www.addtoany.com/buttons/customize/wordpress/floating_share_buttons) share buttons — responsive & customizable, vertical & horizontal
21
  * **Counters** — fast & official [share counts](https://www.addtoany.com/buttons/customize/wordpress/share_counters) in the same style
22
- * **Follow** buttons — [social media links](https://www.addtoany.com/buttons/customize/wordpress/follow_buttons) to your Instagram, YouTube, Snapchat
23
  * **Image** sharing buttons - share buttons for [sharing images](https://www.addtoany.com/buttons/customize/wordpress/image_sharing)
24
  * **Vector** share buttons & follow buttons — [custom color](https://www.addtoany.com/buttons/customize/wordpress/icon_color) SVG icons
25
  * **Custom** share icons — use your own if you prefer
@@ -346,6 +346,11 @@ Upload (or move) the `add-to-any` plugin directory into the `/wp-content/mu-plug
346
 
347
  == Changelog ==
348
 
 
 
 
 
 
349
  = 1.8.0 =
350
  * Switch to more recent WordPress functions (especially for loading plugin script assets)
351
  * Load the local JS file asynchronously by default
4
  Requires at least: 4.5
5
  Tested up to: 5.8
6
  Requires PHP: 5.6
7
+ Stable tag: 1.8.1
8
 
9
  Share buttons for WordPress including the AddToAny sharing button, Facebook, Twitter, WhatsApp, Pinterest, Reddit, many more, and follow icons too.
10
 
19
  * [**Standard**](https://www.addtoany.com/buttons/customize/wordpress/standalone_services) share buttons — share each piece of content
20
  * [**Floating**](https://www.addtoany.com/buttons/customize/wordpress/floating_share_buttons) share buttons — responsive & customizable, vertical & horizontal
21
  * **Counters** — fast & official [share counts](https://www.addtoany.com/buttons/customize/wordpress/share_counters) in the same style
22
+ * **Follow** buttons — [social media links](https://www.addtoany.com/buttons/customize/wordpress/follow_buttons) to your Instagram, YouTube, Discord, Snapchat
23
  * **Image** sharing buttons - share buttons for [sharing images](https://www.addtoany.com/buttons/customize/wordpress/image_sharing)
24
  * **Vector** share buttons & follow buttons — [custom color](https://www.addtoany.com/buttons/customize/wordpress/icon_color) SVG icons
25
  * **Custom** share icons — use your own if you prefer
346
 
347
  == Changelog ==
348
 
349
+ = 1.8.1 =
350
+ * Add Discord follow button
351
+ * Add Snapchat share button
352
+ * Fix AddToAny loading when a non-WordPress version of jQuery is used
353
+
354
  = 1.8.0 =
355
  * Switch to more recent WordPress functions (especially for loading plugin script assets)
356
  * Load the local JS file asynchronously by default
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, LinkedIn, Pinterest, WhatsApp and many more.
6
- * Version: 1.8.0
7
  * Author: AddToAny
8
  * Author URI: https://www.addtoany.com/
9
  * Text Domain: add-to-any
@@ -1100,15 +1100,17 @@ function A2A_SHARE_SAVE_enqueue_script() {
1100
  . '})(document,"script");'
1101
  . "\n";
1102
 
1103
- // Require an `addtoany` script to be queued because wp_add_inline_script() below requires a queued script.
1104
- if ( wp_script_is( 'jquery', 'registered' ) ) {
1105
- wp_enqueue_script( 'addtoany', plugins_url('/addtoany.min.js', __FILE__ ), array( 'jquery' ), '1.1' );
1106
- } else {
1107
- wp_enqueue_script( 'addtoany', '', array(), null );
1108
- }
1109
 
1110
  // Add inline JavaScript. Arbitrary JavaScript is expected from users with the `unfiltered_html` capability.
1111
  wp_add_inline_script( 'addtoany', $inline_javascript );
 
 
 
 
 
1112
 
1113
  // Adjust script tag attributes.
1114
  add_filter( 'script_loader_tag', function ( $tag, $handle, $src ) {
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, LinkedIn, Pinterest, WhatsApp and many more.
6
+ * Version: 1.8.1
7
  * Author: AddToAny
8
  * Author URI: https://www.addtoany.com/
9
  * Text Domain: add-to-any
1100
  . '})(document,"script");'
1101
  . "\n";
1102
 
1103
+ // Require an empty `addtoany` script to be enqueued because wp_add_inline_script() below requires a queued script.
1104
+ wp_register_script( 'addtoany', '' );
1105
+ wp_enqueue_script( 'addtoany' );
 
 
 
1106
 
1107
  // Add inline JavaScript. Arbitrary JavaScript is expected from users with the `unfiltered_html` capability.
1108
  wp_add_inline_script( 'addtoany', $inline_javascript );
1109
+
1110
+ // Load script that depends on jQuery only if jQuery is registered.
1111
+ if ( wp_script_is( 'jquery', 'registered' ) ) {
1112
+ wp_enqueue_script( 'addtoany-jquery', plugins_url('/addtoany.min.js', __FILE__ ), array( 'jquery' ), '1.1' );
1113
+ }
1114
 
1115
  // Adjust script tag attributes.
1116
  add_filter( 'script_loader_tag', function ( $tag, $handle, $src ) {
addtoany.admin.php CHANGED
@@ -534,6 +534,7 @@ function A2A_SHARE_SAVE_options_page() {
534
  <p style="line-height:0">
535
  <img src="<?php echo esc_url( $A2A_SHARE_SAVE_plugin_url ); ?>/icons/instagram.svg" width="24" height="24" style="margin-right:8px">
536
  <img src="<?php echo esc_url( $A2A_SHARE_SAVE_plugin_url ); ?>/icons/youtube.svg" width="24" height="24" style="margin-right:8px">
 
537
  <img src="<?php echo esc_url( $A2A_SHARE_SAVE_plugin_url ); ?>/icons/snapchat.svg" width="24" height="24">
538
  </p>
539
  <p>You can setup Instagram, YouTube, Snapchat, and other buttons in an AddToAny Follow widget.</p><p>Add the &quot;AddToAny Follow&quot; widget in <a href="customize.php?autofocus[panel]=widgets&amp;return=options-general.php%3Fpage%3Daddtoany">Customize</a> or <a href="widgets.php">Widgets</a>.</p>
534
  <p style="line-height:0">
535
  <img src="<?php echo esc_url( $A2A_SHARE_SAVE_plugin_url ); ?>/icons/instagram.svg" width="24" height="24" style="margin-right:8px">
536
  <img src="<?php echo esc_url( $A2A_SHARE_SAVE_plugin_url ); ?>/icons/youtube.svg" width="24" height="24" style="margin-right:8px">
537
+ <img src="<?php echo esc_url( $A2A_SHARE_SAVE_plugin_url ); ?>/icons/discord.svg" width="24" height="24" style="margin-right:8px">
538
  <img src="<?php echo esc_url( $A2A_SHARE_SAVE_plugin_url ); ?>/icons/snapchat.svg" width="24" height="24">
539
  </p>
540
  <p>You can setup Instagram, YouTube, Snapchat, and other buttons in an AddToAny Follow widget.</p><p>Add the &quot;AddToAny Follow&quot; widget in <a href="customize.php?autofocus[panel]=widgets&amp;return=options-general.php%3Fpage%3Daddtoany">Customize</a> or <a href="widgets.php">Widgets</a>.</p>
addtoany.services.php CHANGED
@@ -372,6 +372,11 @@ $A2A_SHARE_SAVE_services = array(
372
  "icon" => "sms",
373
  "color" => "6CBE45",
374
  ),
 
 
 
 
 
375
  "stocktwits" => array(
376
  "name" => "StockTwits",
377
  "icon" => "stocktwits",
372
  "icon" => "sms",
373
  "color" => "6CBE45",
374
  ),
375
+ "snapchat" => array(
376
+ "name" => "Snapchat",
377
+ "icon" => "snapchat",
378
+ "color" => "2A2A2A",
379
+ ),
380
  "stocktwits" => array(
381
  "name" => "StockTwits",
382
  "icon" => "stocktwits",
icons/discord.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"><path d="M23.6 9c-1.4-.6-2.9-1.1-4.5-1.4H19c-.2.3-.4.8-.6 1.1-1.7-.3-3.4-.3-5 0-.2-.4-.4-.8-.6-1.1h-.1c-1.4.3-2.9.8-4.3 1.4-2.9 4.3-3.6 8.4-3.3 12.5v.1c1.9 1.4 3.7 2.2 5.5 2.8h.1c.4-.6.8-1.2 1.1-1.8v-.1c-.6-.2-1.2-.5-1.7-.8v-.1l.3-.3h.1c3.6 1.6 7.5 1.6 11.1 0h.1l.3.3v.1c-.5.3-1.1.6-1.7.8 0 0-.1.1 0 .1.3.6.7 1.2 1.1 1.8h.1c1.8-.6 3.6-1.4 5.5-2.8v-.1c.4-4.7-.9-8.8-3.4-12.5zM12.4 19.1c-1.1 0-2-1-2-2.2s.9-2.2 2-2.2 2 1 2 2.2c-.1 1.2-.9 2.2-2 2.2zm7.3 0c-1.1 0-2-1-2-2.2s.9-2.2 2-2.2 2 1 2 2.2c-.1 1.2-.9 2.2-2 2.2z" fill="#fff"/></svg>