AddToAny Share Buttons - Version 1.6.15

Version Description

  • AddToAny widgets support new selective refresh in the WordPress 4.5 Customizer
  • AddToAny share endpoints default to HTTPS on HTTPS sites
  • Permit changing the target attribute for custom services (thanks Jasper)
  • The meta box ("Show sharing buttons") below the WordPress editor will no longer show when standard placement is disabled for the current post type
  • Add Kik share button
  • Add Skype share button
  • Add Viber share button
  • Add WeChat share button
  • Add Snapchat follow button
Download this release

Release Info

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

Code changes from version 1.6.14 to 1.6.15

README.txt CHANGED
@@ -1,9 +1,9 @@
1
  === AddToAny Share Buttons ===
2
  Contributors: micropat, addtoany
3
- Tags: AddToAny, sharing, share, social, share button, share buttons, share links, social icons, social media, media, marketing, bookmark, bookmarks, save, post, posts, page, pages, images, image, admin, analytics, statistics, stats, links, plugin, shortcode, sidebar, widget, responsive, email, e-mail, print, seo, button, amp, woocommerce, ecommerce, e-commerce, amazon, delicious, google, tumblr, linkedin, digg, reddit, facebook, facebook share, facebook like, like, twitter, twitter button, twitter share, tweet, tweet button, google plus, pinterest, pin, pin it, pinit, wanelo, buffer, stumbleupon, bitly, whatsapp, instagram, behance, flickr, foursquare, vimeo, youtube, feed, rss, lockerz, addthis, sociable, share this, sharethis, shareaholic, icon, icons, vector, SVG, floating, floating buttons, wpml, wpmu, Add to Any
4
  Requires at least: 2.8
5
  Tested up to: 4.5
6
- Stable tag: 1.6.14
7
 
8
  Share buttons for WordPress including the AddToAny sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp, many more, and follow icons too.
9
 
@@ -62,8 +62,8 @@ AddToAny is the universal sharing platform, and AddToAny's plugin is the most po
62
 
63
  = Wide Support =
64
 
65
- * Over 8 years of active development
66
- * Over 4 million downloads
67
  * Translated into dozens of languages
68
  * Ongoing support from the community
69
 
@@ -96,11 +96,11 @@ To install manually instead:
96
 
97
  = Where are the options, and how can I customize the sharing plugin? =
98
 
99
- In your Admin panel, go to `Settings` > `AddToAny`. Among other options, you can choose individual sharing icons, a universal share button, and official 3rd party sharing buttons (Facebook Like Button, Twitter Tweet Button, Pinterest Pin It Button, Google+ Share Button, Google +1 Button) to display, and where and how to display them.
100
 
101
- To place the buttons as a "widget" in your theme (if your theme supports WordPress Widgets), go to `Appearance` > `Widgets`, then drag AddToAny to an available Widget Area and click `Save`.
102
 
103
- To further customize AddToAny, see the <a href="https://www.addtoany.com/buttons/customize/wordpress">WordPress sharing documentation</a> for the AddToAny plugin. Many customizations will have you copy & paste one or more lines of JavaScript code into "Additional JavaScript" box. The Additional JavaScript box is in `Settings` > `AddToAny`.
104
 
105
  = Something is wrong. What should I try first? =
106
 
@@ -127,9 +127,9 @@ You can also display specific share buttons by specifying comma-separated <a hre
127
 
128
  = For Facebook sharing, how can I set the thumbnail image and description Facebook uses? =
129
 
130
- Facebook expects the Title, Description, and Thumbnail of a shared page to be defined in the actual HTML code of a shared page. Unlike other services that accept common parameters, Facebook only accepts a URL, then Facebook scans the actual page for details. To change the title, description or image on Facebook, you will need to modify your theme or use another plugin that filters your theme.
131
 
132
- Use Facebook's <a href="https://developers.facebook.com/tools/debug/">URL Debugger</a> on your pages to see how Facebook reads your site. "Fetch new scrape information" to test site changes and clear Facebook's cache of a page.
133
 
134
  To change the title, description and/or image on Facebook, your theme's header file should be modified according to <a href="https://developers.facebook.com/docs/sharing/opengraph">Facebook's OpenGraph specification</a>. With WordPress, this can be accomplished with plugins such as the <a href="https://wordpress.org/plugins/wordpress-seo/">Yoast SEO</a> or the <a href="https://wordpress.org/plugins/all-in-one-seo-pack/">All in One SEO Pack</a>. Please see those plugins for details, and post in the WordPress or plugin author's forums for more support.
135
 
@@ -164,7 +164,7 @@ If you want to hardcode the shared current URL and modify the title (server-side
164
  } ?>`
165
 
166
  = How can I add a custom standalone share button? =
167
- You can create a plugin or customize the following example PHP code to add to your theme's function.php file:
168
 
169
  `function addtoany_add_services( $services ) {
170
  $services['example_share_service'] = array(
@@ -179,7 +179,7 @@ You can create a plugin or customize the following example PHP code to add to yo
179
  add_filter( 'A2A_SHARE_SAVE_services', 'addtoany_add_services', 10, 1 );`
180
 
181
  = How can I add a custom follow button? =
182
- You can create a plugin or customize the following example PHP code to add to your theme's function.php file:
183
 
184
  `function addtoany_add_follow_services( $services ) {
185
  $services['example_follow_service'] = array(
@@ -300,6 +300,17 @@ Upload (or move) the `add-to-any` plugin directory into the `/wp-content/mu-plug
300
 
301
  == Changelog ==
302
 
 
 
 
 
 
 
 
 
 
 
 
303
  = 1.6.14 =
304
  * [AMP](https://wordpress.org/plugins/amp/) (Accelerated Mobile Pages) support for share buttons in posts
305
  * PHP template code now accepts the `icon_size` argument
1
  === AddToAny Share Buttons ===
2
  Contributors: micropat, addtoany
3
+ Tags: AddToAny, sharing, share, social, share button, share buttons, share links, social icons, social media, media, marketing, bookmark, bookmarks, save, post, posts, page, pages, images, image, admin, analytics, statistics, stats, links, plugin, shortcode, sidebar, widget, responsive, email, e-mail, print, seo, button, amp, woocommerce, ecommerce, e-commerce, amazon, delicious, google, tumblr, linkedin, digg, reddit, facebook, facebook share, facebook like, like, twitter, twitter button, twitter share, tweet, tweet button, google plus, pinterest, pin, pin it, pinit, wanelo, buffer, stumbleupon, bitly, whatsapp, instagram, behance, flickr, foursquare, vimeo, youtube, feed, rss, addthis, sociable, share this, sharethis, shareaholic, icon, icons, vector, SVG, floating, floating buttons, wpml, wpmu, Add to Any
4
  Requires at least: 2.8
5
  Tested up to: 4.5
6
+ Stable tag: 1.6.15
7
 
8
  Share buttons for WordPress including the AddToAny sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp, many more, and follow icons too.
9
 
62
 
63
  = Wide Support =
64
 
65
+ * Over 9 years of active development
66
+ * Over 5 million downloads
67
  * Translated into dozens of languages
68
  * Ongoing support from the community
69
 
96
 
97
  = Where are the options, and how can I customize the sharing plugin? =
98
 
99
+ In your Admin panel, go to `Settings` > `AddToAny`.
100
 
101
+ Setup Follow buttons (like Instagram, YouTube, etc.) using the AddToAny Follow widget in `Appearance` > `Widgets` (or `Appearance` > `Customize`).
102
 
103
+ To further customize AddToAny, see the <a href="https://www.addtoany.com/buttons/customize/wordpress">WordPress sharing documentation</a> for the AddToAny plugin. Many customizations will have you copy & paste one or more lines of code into your "Additional JavaScript" or "Additional CSS" box. Those boxes are in `Settings` > `AddToAny`.
104
 
105
  = Something is wrong. What should I try first? =
106
 
127
 
128
  = For Facebook sharing, how can I set the thumbnail image and description Facebook uses? =
129
 
130
+ Facebook expects the Title, Description, and Thumbnail of a shared page to be defined in the Open Graph <a href="https://www.addtoany.com/ext/meta-tags/" target="_blank">meta tags</a> of a shared page.
131
 
132
+ Use Facebook's <a href="https://developers.facebook.com/tools/debug/og/object/">URL Debugger</a> on your pages to see how Facebook reads your site. "Fetch new scrape information" to test site changes and clear Facebook's cache of a page.
133
 
134
  To change the title, description and/or image on Facebook, your theme's header file should be modified according to <a href="https://developers.facebook.com/docs/sharing/opengraph">Facebook's OpenGraph specification</a>. With WordPress, this can be accomplished with plugins such as the <a href="https://wordpress.org/plugins/wordpress-seo/">Yoast SEO</a> or the <a href="https://wordpress.org/plugins/all-in-one-seo-pack/">All in One SEO Pack</a>. Please see those plugins for details, and post in the WordPress or plugin author's forums for more support.
135
 
164
  } ?>`
165
 
166
  = How can I add a custom standalone share button? =
167
+ You can create a plugin or customize the following example PHP code to add to your theme's functions.php file:
168
 
169
  `function addtoany_add_services( $services ) {
170
  $services['example_share_service'] = array(
179
  add_filter( 'A2A_SHARE_SAVE_services', 'addtoany_add_services', 10, 1 );`
180
 
181
  = How can I add a custom follow button? =
182
+ You can create a plugin or customize the following example PHP code to add to your theme's functions.php file:
183
 
184
  `function addtoany_add_follow_services( $services ) {
185
  $services['example_follow_service'] = array(
300
 
301
  == Changelog ==
302
 
303
+ = 1.6.15 =
304
+ * AddToAny widgets support new selective refresh in the WordPress 4.5 Customizer
305
+ * AddToAny share endpoints default to HTTPS on HTTPS sites
306
+ * Permit changing the target attribute for custom services (thanks Jasper)
307
+ * The meta box ("Show sharing buttons") below the WordPress editor will no longer show when standard placement is disabled for the current post type
308
+ * Add Kik share button
309
+ * Add Skype share button
310
+ * Add Viber share button
311
+ * Add WeChat share button
312
+ * Add Snapchat follow button
313
+
314
  = 1.6.14 =
315
  * [AMP](https://wordpress.org/plugins/amp/) (Accelerated Mobile Pages) support for share buttons in posts
316
  * PHP template code now accepts the `icon_size` argument
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. [<a href="options-general.php?page=addtoany">Settings</a>]
6
- Version: 1.6.14
7
  Author: AddToAny
8
  Author URI: https://www.addtoany.com/
9
  Text Domain: add-to-any
@@ -202,6 +202,7 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
202
  $args = wp_parse_args( $args, $defaults );
203
  extract( $args );
204
 
 
205
  $is_amp = function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ? true : false;
206
 
207
  // False if "icon_size" is set to '16', or no_small_icons arg is true
@@ -316,19 +317,25 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
316
  $height_attr = isset( $service['icon_height'] ) ? ' height="' . $service['icon_height'] . '"' : ' height="16"';
317
  $height_attr = $is_amp && isset( $icon_size ) ? ' height="' . $icon_size . '"' : $height_attr;
318
 
319
- $url = ( isset( $href ) ) ? $href : "http://www.addtoany.com/add_to/" . $safe_name . "?linkurl=" . $linkurl_enc . "&amp;linkname=" . $linkname_enc;
320
  $src = ( $icon_url ) ? $icon_url : $icons_dir . $icon . '.' . $icons_type;
321
  $counter = ( $counter_enabled ) ? ' a2a_counter' : '';
322
  $class_attr = ( $custom_service ) ? '' : ' class="a2a_button_' . $safe_name . $counter . '"';
323
  $rel_nofollow = $is_follow ? '' : ' rel="nofollow"'; // ($is_follow indicates a Follow Kit. 'nofollow' is for search crawlers. Different things)
324
 
 
 
 
 
 
 
325
  // Set dimension attributes if using custom icons and dimension is specified
326
  if ( isset( $custom_icons ) ) {
327
  $width_attr = ! empty( $icons_width ) ? ' width="' . $icons_width . '"' : '';
328
  $height_attr = ! empty( $icons_height ) ? ' height="' . $icons_height . '"' : '';
329
  }
330
 
331
- $link = $html_wrap_open . "<a$class_attr href=\"$url\" title=\"$name\"$rel_nofollow target=\"_blank\">";
332
  $link .= ( $large_icons && ! isset( $custom_icons ) && ! $custom_service ) ? "" : "<img src=\"$src\"" . $width_attr . $height_attr . " alt=\"$name\"/>";
333
  $link .= "</a>" . $html_wrap_close;
334
  }
@@ -752,12 +759,12 @@ function A2A_SHARE_SAVE_head_script() {
752
 
753
  $options = get_option( 'addtoany_options' );
754
 
755
- $http_or_https = ( is_ssl() ) ? 'https' : 'http';
756
 
757
  // Use local cache?
758
  $cache = ( isset( $options['cache'] ) && '1' == $options['cache'] ) ? true : false;
759
  $upload_dir = wp_upload_dir();
760
- $static_server = ( $cache ) ? $upload_dir['baseurl'] . '/addtoany' : $http_or_https . '://static.addtoany.com/menu';
761
 
762
  // Enternal script call + initial JS + set-once variables
763
  $additional_js = ( isset( $options['additional_js_variables'] ) ) ? $options['additional_js_variables'] : '' ;
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. [<a href="options-general.php?page=addtoany">Settings</a>]
6
+ Version: 1.6.15
7
  Author: AddToAny
8
  Author URI: https://www.addtoany.com/
9
  Text Domain: add-to-any
202
  $args = wp_parse_args( $args, $defaults );
203
  extract( $args );
204
 
205
+ $https_or_http = is_ssl() ? 'https' : 'http';
206
  $is_amp = function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ? true : false;
207
 
208
  // False if "icon_size" is set to '16', or no_small_icons arg is true
317
  $height_attr = isset( $service['icon_height'] ) ? ' height="' . $service['icon_height'] . '"' : ' height="16"';
318
  $height_attr = $is_amp && isset( $icon_size ) ? ' height="' . $icon_size . '"' : $height_attr;
319
 
320
+ $url = ( isset( $href ) ) ? $href : $https_or_http . '://www.addtoany.com/add_to/' . $safe_name . '?linkurl=' . $linkurl_enc .'&amp;linkname=' . $linkname_enc;
321
  $src = ( $icon_url ) ? $icon_url : $icons_dir . $icon . '.' . $icons_type;
322
  $counter = ( $counter_enabled ) ? ' a2a_counter' : '';
323
  $class_attr = ( $custom_service ) ? '' : ' class="a2a_button_' . $safe_name . $counter . '"';
324
  $rel_nofollow = $is_follow ? '' : ' rel="nofollow"'; // ($is_follow indicates a Follow Kit. 'nofollow' is for search crawlers. Different things)
325
 
326
+ if ( isset( $service['target'] ) ) {
327
+ $target_attr = empty( $service['target'] ) ? '' : ' target="' . $service['target'] . '"';
328
+ } else {
329
+ $target_attr = ' target="_blank"';
330
+ }
331
+
332
  // Set dimension attributes if using custom icons and dimension is specified
333
  if ( isset( $custom_icons ) ) {
334
  $width_attr = ! empty( $icons_width ) ? ' width="' . $icons_width . '"' : '';
335
  $height_attr = ! empty( $icons_height ) ? ' height="' . $icons_height . '"' : '';
336
  }
337
 
338
+ $link = $html_wrap_open . "<a$class_attr href=\"$url\" title=\"$name\"$rel_nofollow$target_attr>";
339
  $link .= ( $large_icons && ! isset( $custom_icons ) && ! $custom_service ) ? "" : "<img src=\"$src\"" . $width_attr . $height_attr . " alt=\"$name\"/>";
340
  $link .= "</a>" . $html_wrap_close;
341
  }
759
 
760
  $options = get_option( 'addtoany_options' );
761
 
762
+ $https_or_http = is_ssl() ? 'https' : 'http';
763
 
764
  // Use local cache?
765
  $cache = ( isset( $options['cache'] ) && '1' == $options['cache'] ) ? true : false;
766
  $upload_dir = wp_upload_dir();
767
+ $static_server = ( $cache ) ? $upload_dir['baseurl'] . '/addtoany' : $https_or_http . '://static.addtoany.com/menu';
768
 
769
  // Enternal script call + initial JS + set-once variables
770
  $additional_js = ( isset( $options['additional_js_variables'] ) ) ? $options['additional_js_variables'] : '' ;
addtoany.admin.js ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Init AddToAny when an AddToAny WordPress Widget is selectively refreshed for customizer preview. */
2
+ jQuery( function() {
3
+ // Short-circuit selective refresh events if not in customizer preview or pre-4.5.
4
+ if ( 'undefined' === typeof wp || ! wp.customize || ! wp.customize.selectiveRefresh ) {
5
+ return;
6
+ }
7
+
8
+ function addtoany_init() {
9
+ if ( ! wpa2a )
10
+ return;
11
+
12
+ if (wpa2a.script_ready)
13
+ wpa2a.init();
14
+
15
+ // Load external script if not already called
16
+ wpa2a.script_load();
17
+ }
18
+
19
+ // Init AddToAny when a partial is rendered.
20
+ wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function( placement ) {
21
+ if ( placement.container ) {
22
+ addtoany_init();
23
+ }
24
+ } );
25
+ } );
addtoany.admin.php CHANGED
@@ -7,8 +7,22 @@ function A2A_SHARE_SAVE_add_meta_box() {
7
  // get_post_types() only included in WP 2.9/3.0
8
  $post_types = ( function_exists( 'get_post_types' ) ) ? get_post_types( array( 'public' => true ) ) : array( 'post', 'page' ) ;
9
 
 
 
10
  $title = apply_filters( 'A2A_SHARE_SAVE_meta_box_title', __( 'AddToAny', 'add-to-any' ) );
11
  foreach( $post_types as $post_type ) {
 
 
 
 
 
 
 
 
 
 
 
 
12
  add_meta_box( 'A2A_SHARE_SAVE_meta', $title, 'A2A_SHARE_SAVE_meta_box_content', $post_type, 'advanced', 'high' );
13
  }
14
  }
7
  // get_post_types() only included in WP 2.9/3.0
8
  $post_types = ( function_exists( 'get_post_types' ) ) ? get_post_types( array( 'public' => true ) ) : array( 'post', 'page' ) ;
9
 
10
+ $options = get_option( 'addtoany_options' );
11
+
12
  $title = apply_filters( 'A2A_SHARE_SAVE_meta_box_title', __( 'AddToAny', 'add-to-any' ) );
13
  foreach( $post_types as $post_type ) {
14
+ // If automatic placement is disabled for the post type
15
+ if (
16
+ 'post' == $post_type && isset( $options['display_in_posts'] ) && $options['display_in_posts'] == '-1' ||
17
+ 'page' == $post_type && isset( $options['display_in_pages'] ) && $options['display_in_pages'] == '-1' ||
18
+ // Custom post type
19
+ isset( $options['display_in_cpt_' . $post_type] ) && $options['display_in_cpt_' . $post_type] == '-1'
20
+ ) {
21
+ // Skip current post type
22
+ continue;
23
+ }
24
+
25
+ // Add meta box (unless we skipped this post type above)
26
  add_meta_box( 'A2A_SHARE_SAVE_meta', $title, 'A2A_SHARE_SAVE_meta_box_content', $post_type, 'advanced', 'high' );
27
  }
28
  }
addtoany.services.php CHANGED
@@ -190,6 +190,10 @@ $A2A_SHARE_SAVE_services = array(
190
  "name" => "Kakao",
191
  "icon" => "kakao",
192
  ),
 
 
 
 
193
  "kindle_it" => array(
194
  "name" => "Kindle It",
195
  "icon" => "kindle",
@@ -306,6 +310,10 @@ $A2A_SHARE_SAVE_services = array(
306
  "name" => "SiteJot",
307
  "icon" => "sitejot",
308
  ),
 
 
 
 
309
  "slashdot" => array(
310
  "name" => "Slashdot",
311
  "icon" => "slashdot",
@@ -346,6 +354,10 @@ $A2A_SHARE_SAVE_services = array(
346
  "name" => "Viadeo",
347
  "icon" => "viadeo",
348
  ),
 
 
 
 
349
  "vk" => array(
350
  "name" => "VK",
351
  "icon" => "vk",
@@ -358,6 +370,10 @@ $A2A_SHARE_SAVE_services = array(
358
  "name" => "Webnews",
359
  "icon" => "webnews",
360
  ),
 
 
 
 
361
  "wordpress" => array(
362
  "name" => "WordPress",
363
  "icon" => "wordpress",
@@ -398,6 +414,7 @@ $A2A_SHARE_SAVE_services = array(
398
  );
399
 
400
  $A2A_FOLLOW_services = array(
 
401
  'facebook' => array(
402
  'name' => 'Facebook',
403
  'href' => 'https://www.facebook.com/${id}',
@@ -453,6 +470,11 @@ $A2A_FOLLOW_services = array(
453
  'href' => 'https://www.linkedin.com/company/${id}',
454
  'icon' => 'linkedin',
455
  ),
 
 
 
 
 
456
  'tumblr' => array(
457
  'name' => 'Tumblr',
458
  'href' => 'http://${id}.tumblr.com',
@@ -478,4 +500,5 @@ $A2A_FOLLOW_services = array(
478
  'href' => 'http://www.example.com/feed/',
479
  'icon' => 'feed',
480
  ),
 
481
  );
190
  "name" => "Kakao",
191
  "icon" => "kakao",
192
  ),
193
+ "kik" => array(
194
+ "name" => "Kik",
195
+ "icon" => "kik",
196
+ ),
197
  "kindle_it" => array(
198
  "name" => "Kindle It",
199
  "icon" => "kindle",
310
  "name" => "SiteJot",
311
  "icon" => "sitejot",
312
  ),
313
+ "skype" => array(
314
+ "name" => "Skype",
315
+ "icon" => "skype",
316
+ ),
317
  "slashdot" => array(
318
  "name" => "Slashdot",
319
  "icon" => "slashdot",
354
  "name" => "Viadeo",
355
  "icon" => "viadeo",
356
  ),
357
+ "viber" => array(
358
+ "name" => "Viber",
359
+ "icon" => "viber",
360
+ ),
361
  "vk" => array(
362
  "name" => "VK",
363
  "icon" => "vk",
370
  "name" => "Webnews",
371
  "icon" => "webnews",
372
  ),
373
+ "wechat" => array(
374
+ "name" => "WeChat",
375
+ "icon" => "wechat",
376
+ ),
377
  "wordpress" => array(
378
  "name" => "WordPress",
379
  "icon" => "wordpress",
414
  );
415
 
416
  $A2A_FOLLOW_services = array(
417
+
418
  'facebook' => array(
419
  'name' => 'Facebook',
420
  'href' => 'https://www.facebook.com/${id}',
470
  'href' => 'https://www.linkedin.com/company/${id}',
471
  'icon' => 'linkedin',
472
  ),
473
+ 'snapchat' => array(
474
+ 'name' => 'Snapchat',
475
+ 'href' => 'https://www.snapchat.com/add/${id}',
476
+ 'icon' => 'snapchat',
477
+ ),
478
  'tumblr' => array(
479
  'name' => 'Tumblr',
480
  'href' => 'http://${id}.tumblr.com',
500
  'href' => 'http://www.example.com/feed/',
501
  'icon' => 'feed',
502
  ),
503
+
504
  );
addtoany.widgets.php CHANGED
@@ -13,10 +13,22 @@ class A2A_SHARE_SAVE_Widget extends WP_Widget {
13
 
14
  /** constructor */
15
  function __construct() {
16
- $widget_ops = array( 'description' => 'Share buttons for sharing your content.' );
17
- parent::__construct( '', 'AddToAny Share', $widget_ops );
 
 
 
 
 
 
 
 
18
  }
19
 
 
 
 
 
20
  /** Backwards compatibility for A2A_SHARE_SAVE_Widget::display(); usage */
21
  public function display( $args = false ) {
22
  self::widget( $args, NULL );
@@ -92,9 +104,24 @@ class A2A_Follow_Widget extends WP_Widget {
92
 
93
  /** constructor */
94
  function __construct() {
95
- $widget_ops = array( 'description' => 'Follow buttons link to your social media.' );
 
 
 
96
  parent::__construct( '', 'AddToAny Follow', $widget_ops );
 
 
 
 
 
97
  }
 
 
 
 
 
 
 
98
 
99
  /**
100
  * @param array $args
13
 
14
  /** constructor */
15
  function __construct() {
16
+ $widget_ops = array(
17
+ 'description' => 'Share buttons for sharing your content.',
18
+ 'customize_selective_refresh' => true,
19
+ );
20
+ parent::__construct( '', 'AddToAny Share', $widget_ops );
21
+
22
+ // Enqueue script if widget is active (appears in a sidebar) or if in Customizer preview.
23
+ if ( is_active_widget( false, false, $this->id_base ) || is_customize_preview() ) {
24
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
25
+ }
26
  }
27
 
28
+ public function enqueue_scripts() {
29
+ wp_enqueue_script( 'addtoany-widget-init', plugins_url( 'addtoany.admin.js', __FILE__ ), array(), '0.1', true );
30
+ }
31
+
32
  /** Backwards compatibility for A2A_SHARE_SAVE_Widget::display(); usage */
33
  public function display( $args = false ) {
34
  self::widget( $args, NULL );
104
 
105
  /** constructor */
106
  function __construct() {
107
+ $widget_ops = array(
108
+ 'description' => 'Follow buttons link to your social media.',
109
+ 'customize_selective_refresh' => true,
110
+ );
111
  parent::__construct( '', 'AddToAny Follow', $widget_ops );
112
+
113
+ // Enqueue script if widget is active (appears in a sidebar) or if in Customizer preview.
114
+ if ( is_active_widget( false, false, $this->id_base ) || is_customize_preview() ) {
115
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
116
+ }
117
  }
118
+
119
+ /**
120
+ * Enqueue a script with jQuery as a dependency.
121
+ */
122
+ public function enqueue_scripts() {
123
+ wp_enqueue_script( 'addtoany-widget-init', plugins_url( 'addtoany.admin.js', __FILE__ ), array('jquery'), '0.1', true );
124
+ }
125
 
126
  /**
127
  * @param array $args
icons/kik.png ADDED
Binary file
icons/skype.png ADDED
Binary file
icons/snapchat.png ADDED
Binary file
icons/viber.png ADDED
Binary file
icons/wechat.png ADDED
Binary file