AddToAny Share Buttons - Version 1.6.8

Version Description

  • Universal share counter is now available
  • Tweet counters have been removed because Twitter no longer provides counts
  • Official buttons (Facebook Like, etc.) have been moved to the bottom of the available services list
  • Support WP-CLI v0.21.0+ (thanks Compute and Daniel Bachhuber)
  • Support bootstrapped WordPress
  • Support for other script loading methods
Download this release

Release Info

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

Code changes from version 1.6.7 to 1.6.8

Files changed (3) hide show
  1. README.txt +11 -3
  2. add-to-any.php +12 -5
  3. addtoany.admin.php +35 -29
README.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: micropat, addtoany
3
  Tags: AddToAny, sharing, share, social, share button, share buttons, 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, 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.4
6
- Stable tag: 1.6.7
7
 
8
  Share buttons for WordPress including the AddToAny sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp, many more, and follow icons too.
9
 
@@ -68,7 +68,7 @@ AddToAny is the universal sharing platform, and AddToAny's plugin is the most po
68
 
69
  This plugin always strives to be the best WordPress plugin for sharing. Development is fueled by your praise and feedback.
70
 
71
- <a href="https://www.addtoany.com/share_save" title="Share">Share</a> this plugin
72
 
73
  See also:
74
 
@@ -297,6 +297,14 @@ Upload (or move) the `add-to-any` plugin directory into the `/wp-content/mu-plug
297
 
298
  == Changelog ==
299
 
 
 
 
 
 
 
 
 
300
  = 1.6.7 =
301
  * New Additional CSS box for AddToAny CSS customizations
302
  * Rename Additional Options box to Additional JavaScript box
@@ -752,7 +760,7 @@ Upload (or move) the `add-to-any` plugin directory into the `/wp-content/mu-plug
752
  * Asynchronous loading (faster, non-blocking, major new feature!)
753
  * Supports most themes and additionally works around buggy themes that improperly process content for excerpts, featured/related posts, etc.
754
  * Improperly-coded themes may prevent AddToAny from fully loading
755
- * If your theme is coded improperly, you can switch to the previous plugin version (<a href="">download version .9.9.8.3</a>) until you switch to a working theme or your theme author fixes the issue
756
  * See the FAQ entry for "Why isn't the drop-down menu appearing?" for more information
757
  * Google +1 button
758
  * HTTPS support for Facebook Like & Twitter Tweet buttons (Google +1 button always uses HTTPS)
3
  Tags: AddToAny, sharing, share, social, share button, share buttons, 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, 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.4
6
+ Stable tag: 1.6.8
7
 
8
  Share buttons for WordPress including the AddToAny sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp, many more, and follow icons too.
9
 
68
 
69
  This plugin always strives to be the best WordPress plugin for sharing. Development is fueled by your praise and feedback.
70
 
71
+ <a href="https://www.addtoany.com/share" title="Share">Share</a> this plugin
72
 
73
  See also:
74
 
297
 
298
  == Changelog ==
299
 
300
+ = 1.6.8 =
301
+ * Universal share counter is now available
302
+ * Tweet counters have been removed because <a href="https://www.addtoany.com/blog/twitter-share-count/">Twitter no longer provides counts</a>
303
+ * Official buttons (Facebook Like, etc.) have been moved to the bottom of the available services list
304
+ * Support WP-CLI v0.21.0+ (thanks Compute and Daniel Bachhuber)
305
+ * Support bootstrapped WordPress
306
+ * Support for other script loading methods
307
+
308
  = 1.6.7 =
309
  * New Additional CSS box for AddToAny CSS customizations
310
  * Rename Additional Options box to Additional JavaScript box
760
  * Asynchronous loading (faster, non-blocking, major new feature!)
761
  * Supports most themes and additionally works around buggy themes that improperly process content for excerpts, featured/related posts, etc.
762
  * Improperly-coded themes may prevent AddToAny from fully loading
763
+ * If your theme is coded improperly, you can switch to the previous plugin version until you switch to a working theme or your theme author fixes the issue
764
  * See the FAQ entry for "Why isn't the drop-down menu appearing?" for more information
765
  * Google +1 button
766
  * HTTPS support for Facebook Like & Twitter Tweet buttons (Google +1 button always uses HTTPS)
add-to-any.php CHANGED
@@ -3,13 +3,17 @@
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=add-to-any.php">Settings</a>]
6
- Version: 1.6.7
7
  Author: AddToAny
8
  Author URI: https://www.addtoany.com/
9
  Text Domain: add-to-any
10
  Domain Path: /languages
11
  */
12
-
 
 
 
 
13
  $A2A_SHARE_SAVE_plugin_basename = plugin_basename( dirname( __FILE__ ) );
14
  $A2A_SHARE_SAVE_plugin_dir = untrailingslashit( plugin_dir_path( __FILE__ ) );
15
  $A2A_SHARE_SAVE_plugin_url_path = untrailingslashit( plugin_dir_url( __FILE__ ) );
@@ -282,7 +286,7 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
282
  // AddToAny counter enabled?
283
  $counter_enabled = ( ! $is_follow // Disable counters on Follow Kits
284
  && ! isset( $is_floating ) // Disable counters on floating buttons for now
285
- && in_array( $active_service, array( 'facebook', 'twitter', 'pinterest', 'linkedin', 'reddit' ) )
286
  && isset( $options['special_' . $active_service . '_options'] )
287
  && isset( $options['special_' . $active_service . '_options']['show_count'] )
288
  && $options['special_' . $active_service . '_options']['show_count'] == '1'
@@ -414,6 +418,10 @@ function ADDTOANY_SHARE_SAVE_BUTTON( $args = array() ) {
414
  $button = '<img src="' . $button_src . '"' . $button_width . $button_height . ' alt="Share"/>';
415
  }
416
 
 
 
 
 
417
  $button_html = $html_container_open . $html_wrap_open . '<a class="a2a_dd' . $button_class . ' addtoany_share_save" href="https://www.addtoany.com/share' .$button_href_querystring . '"' . $button_id
418
  . $style . $button_target
419
  . '>' . $button . '</a>';
@@ -469,7 +477,7 @@ function ADDTOANY_SHARE_SAVE_BUTTON( $args = array() ) {
469
 
470
  if ( ! $_addtoany_init ) {
471
  $javascript_load_early = "\n<script type=\"text/javascript\"><!--\n"
472
- . "wpa2a.script_load();"
473
  . "\n//--></script>\n";
474
  } else {
475
  $javascript_load_early = "";
@@ -513,7 +521,6 @@ function ADDTOANY_SHARE_SAVE_SPECIAL( $special_service_code, $args = array() ) {
513
  }
514
 
515
  elseif ( $special_service_code == 'twitter_tweet' ) {
516
- $custom_attributes .= ( $options['special_twitter_tweet_options']['show_count'] == '1' ) ? ' data-count="horizontal"' : ' data-count="none"';
517
  $custom_attributes .= ' data-url="' . $linkurl . '"';
518
  $custom_attributes .= ' data-text="' . $linkname . '"';
519
  $special_html = sprintf( $special_anchor_template, $special_service_code, $custom_attributes );
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=add-to-any.php">Settings</a>]
6
+ Version: 1.6.8
7
  Author: AddToAny
8
  Author URI: https://www.addtoany.com/
9
  Text Domain: add-to-any
10
  Domain Path: /languages
11
  */
12
+
13
+ // Explicitly globalize to support bootstrapped WordPress
14
+ global $_addtoany_counter, $_addtoany_init, $_addtoany_targets, $A2A_locale, $A2A_FOLLOW_services, $A2A_SHARE_SAVE_auto_placement_ready,
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__ ) );
19
  $A2A_SHARE_SAVE_plugin_url_path = untrailingslashit( plugin_dir_url( __FILE__ ) );
286
  // AddToAny counter enabled?
287
  $counter_enabled = ( ! $is_follow // Disable counters on Follow Kits
288
  && ! isset( $is_floating ) // Disable counters on floating buttons for now
289
+ && in_array( $active_service, array( 'facebook', 'pinterest', 'linkedin', 'reddit' ) )
290
  && isset( $options['special_' . $active_service . '_options'] )
291
  && isset( $options['special_' . $active_service . '_options']['show_count'] )
292
  && $options['special_' . $active_service . '_options']['show_count'] == '1'
418
  $button = '<img src="' . $button_src . '"' . $button_width . $button_height . ' alt="Share"/>';
419
  }
420
 
421
+ if ( isset( $options['button_show_count'] ) && $options['button_show_count'] == '1' ) {
422
+ $button_class .= ' a2a_counter';
423
+ }
424
+
425
  $button_html = $html_container_open . $html_wrap_open . '<a class="a2a_dd' . $button_class . ' addtoany_share_save" href="https://www.addtoany.com/share' .$button_href_querystring . '"' . $button_id
426
  . $style . $button_target
427
  . '>' . $button . '</a>';
477
 
478
  if ( ! $_addtoany_init ) {
479
  $javascript_load_early = "\n<script type=\"text/javascript\"><!--\n"
480
+ . "if(wpa2a)wpa2a.script_load();"
481
  . "\n//--></script>\n";
482
  } else {
483
  $javascript_load_early = "";
521
  }
522
 
523
  elseif ( $special_service_code == 'twitter_tweet' ) {
 
524
  $custom_attributes .= ' data-url="' . $linkurl . '"';
525
  $custom_attributes .= ' data-text="' . $linkname . '"';
526
  $special_html = sprintf( $special_anchor_template, $special_service_code, $custom_attributes );
addtoany.admin.php CHANGED
@@ -262,6 +262,7 @@ function A2A_SHARE_SAVE_options_page() {
262
  $new_options['icon_size'] = ( isset( $_POST['A2A_SHARE_SAVE_icon_size'] ) ) ? $_POST['A2A_SHARE_SAVE_icon_size'] : '';
263
  $new_options['button'] = ( isset( $_POST['A2A_SHARE_SAVE_button'] ) ) ? $_POST['A2A_SHARE_SAVE_button'] : '';
264
  $new_options['button_custom'] = ( isset( $_POST['A2A_SHARE_SAVE_button_custom'] ) ) ? $_POST['A2A_SHARE_SAVE_button_custom'] : '';
 
265
  $new_options['header'] = ( isset( $_POST['A2A_SHARE_SAVE_header'] ) ) ? $_POST['A2A_SHARE_SAVE_header'] : '';
266
  $new_options['additional_js_variables'] = ( isset( $_POST['A2A_SHARE_SAVE_additional_js_variables'] ) ) ? trim( $_POST['A2A_SHARE_SAVE_additional_js_variables'] ) : '';
267
  $new_options['additional_css'] = ( isset( $_POST['A2A_SHARE_SAVE_additional_css'] ) ) ? trim( $_POST['A2A_SHARE_SAVE_additional_css'] ) : '';
@@ -303,7 +304,7 @@ function A2A_SHARE_SAVE_options_page() {
303
  $active_services[] = $service;
304
 
305
  // AddToAny counter enabled?
306
- if ( in_array( $service, array( 'facebook', 'twitter', 'pinterest', 'linkedin', 'reddit' ) ) ) {
307
  $new_options['special_' . $service . '_options'] = array(
308
  'show_count' => ( ( isset( $_POST['addtoany_' . $service . '_show_count'] ) && $_POST['addtoany_' . $service . '_show_count'] == '1') ? '1' : '-1' )
309
  );
@@ -317,7 +318,7 @@ function A2A_SHARE_SAVE_options_page() {
317
  'verb' => ( ( isset( $_POST['addtoany_facebook_like_verb'] ) && $_POST['addtoany_facebook_like_verb'] == 'recommend') ? 'recommend' : 'like' )
318
  );
319
  $new_options['special_twitter_tweet_options'] = array(
320
- 'show_count' => ( ( isset( $_POST['addtoany_twitter_tweet_show_count'] ) && $_POST['addtoany_twitter_tweet_show_count'] == '1' ) ? '1' : '-1' )
321
  );
322
  $new_options['special_google_plusone_options'] = array(
323
  'show_count' => ( ( isset( $_POST['addtoany_google_plusone_show_count'] ) && $_POST['addtoany_google_plusone_show_count'] == '1' ) ? '1' : '-1' )
@@ -433,21 +434,6 @@ function A2A_SHARE_SAVE_options_page() {
433
  </ul>
434
  <p id="addtoany_services_info"><?php _e("Choose the services you want below. &nbsp;Click a chosen service again to remove. &nbsp;Reorder services by dragging and dropping as they appear above.", 'add-to-any'); ?></p>
435
  <ul id="addtoany_services_selectable" class="addtoany_admin_list">
436
- <li id="a2a_wp_facebook_like" class="addtoany_special_service addtoany_3p_button" title="Facebook Like button">
437
- <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/facebook_like.png'; ?>" width="50" height="20" alt="Facebook Like" /></span>
438
- </li>
439
- <li id="a2a_wp_twitter_tweet" class="addtoany_special_service addtoany_3p_button" title="Twitter Tweet button">
440
- <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/twitter_tweet.png'; ?>" width="55" height="20" alt="Twitter Tweet" /></span>
441
- </li>
442
- <li id="a2a_wp_google_plusone" class="addtoany_special_service addtoany_3p_button" title="Google +1 button">
443
- <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/google_plusone.png'; ?>" width="32" height="20" alt="Google +1" /></span>
444
- </li>
445
- <li id="a2a_wp_google_plus_share" class="addtoany_special_service addtoany_3p_button" title="Google+ Share button">
446
- <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/google_plus_share.png'; ?>" width="56" height="20" alt="Google+ Share" /></span>
447
- </li>
448
- <li id="a2a_wp_pinterest_pin" class="addtoany_special_service addtoany_3p_button" title="Pinterest Pin It button">
449
- <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/pinterest_pin.png'; ?>" width="40" height="20" alt="Pinterest Pin It" /></span>
450
- </li>
451
  <?php
452
  // Show all services
453
  foreach ($A2A_SHARE_SAVE_services as $service_safe_name=>$site) {
@@ -459,7 +445,7 @@ function A2A_SHARE_SAVE_options_page() {
459
  if ( ! isset( $site['icon'] ) )
460
  $site['icon'] = 'default';
461
 
462
- $special_service = ( in_array( $service_safe_name, array( 'facebook', 'twitter', 'pinterest', 'linkedin', 'reddit' ) ) )
463
  ? ' class="addtoany_special_service"' : '';
464
  ?>
465
  <li data-addtoany-icon-name="<?php echo $site['icon']; ?>"<?php echo $special_service; ?> id="a2a_wp_<?php echo $service_safe_name; ?>" title="<?php echo $site['name']; ?>">
@@ -467,6 +453,21 @@ function A2A_SHARE_SAVE_options_page() {
467
  </li>
468
  <?php
469
  } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
470
  </ul>
471
  </fieldset></td>
472
  </tr>
@@ -527,6 +528,12 @@ function A2A_SHARE_SAVE_options_page() {
527
  <input name="A2A_SHARE_SAVE_button" value="NONE" type="radio"<?php if ( isset( $options['button'] ) && 'NONE' == $options['button'] ) echo ' checked="checked"'; ?> onclick="return confirm('<?php _e('This option will disable universal sharing. Are you sure you want to disable universal sharing?', 'add-to-any' ) ?>')" style="margin:9px 0;vertical-align:middle">
528
  <span style="margin:0 9px;vertical-align:middle"><?php _e("None"); ?></span>
529
  </label>
 
 
 
 
 
 
530
 
531
  </fieldset></td>
532
  </tr>
@@ -897,7 +904,7 @@ function A2A_SHARE_SAVE_admin_head() {
897
  // Special service options?
898
  service_name = services_array[i].substr(7);
899
  if (service_name == 'facebook_like' || service_name == 'twitter_tweet' || service_name == 'google_plusone' || service_name == 'google_plus_share' || service_name == 'pinterest_pin') {
900
- if (service_name == 'twitter_tweet' || service_name == 'google_plusone' || service_name == 'google_plus_share' || service_name == 'pinterest_pin') {
901
  show_count_value = (jQuery('#' + services_array[i] + '_show_count').is(':checked')) ? '1' : '-1' ;
902
  jQuery('#addtoany_admin_form').append('<input class="addtoany_hidden_options" name="addtoany_' + service_name + '_show_count" type="hidden" value="' + show_count_value + '"/>');
903
  }
@@ -907,7 +914,7 @@ function A2A_SHARE_SAVE_admin_head() {
907
  jQuery('#addtoany_admin_form').append('<input class="addtoany_hidden_options" name="addtoany_' + service_name + '_verb" type="hidden" value="' + fb_verb_value + '"/>');
908
  }
909
  // AddToAny counters
910
- } else if ( jQuery.inArray( service_name, ['facebook', 'twitter', 'pinterest', 'linkedin', 'reddit'] ) > -1 ) {
911
  show_count_value = (jQuery('#' + services_array[i] + '_show_count').is(':checked')) ? '1' : '-1' ;
912
  jQuery('#addtoany_admin_form').append('<input class="addtoany_hidden_options" name="addtoany_' + service_name + '_show_count" type="hidden" value="' + show_count_value + '"/>');
913
  }
@@ -938,22 +945,26 @@ function A2A_SHARE_SAVE_admin_head() {
938
  jQuery('#addtoany_services_sortable').find('.dummy').hide();
939
 
940
  if (this_service_is_special) {
941
- if (this_service_name == 'facebook_like') {
942
  if (service_options[this_service_name] && service_options[this_service_name].verb)
943
  checked = ' selected="selected"';
944
  special_options_html = '<select id="' + this_service.attr('id') + '_verb" name="' + this_service.attr('id') + '_verb">'
945
  + '<option value="like">Like</option>'
946
  + '<option' + checked + ' value="recommend">Recommend</option>'
947
  + '</select>';
 
 
948
  } else {
949
- // twitter_tweet & google_plusone & google_plus_share & pinterest_pin
950
  if (service_options[this_service_name] && service_options[this_service_name].show_count) {
951
  checked = ' checked="checked"';
952
  }
953
  special_options_html = '<label><input' + checked + ' id="' + this_service.attr('id') + '_show_count" name="' + this_service.attr('id') + '_show_count" type="checkbox" value="1"> Show count</label>';
954
  }
955
 
956
- configurable_html = '<span class="down_arrow"></span><br style="clear:both"/><div class="special_options">' + special_options_html + '</div>';
 
 
957
  }
958
 
959
  var icon_size = jQuery('input:radio[name=A2A_SHARE_SAVE_icon_size]:checked').val();
@@ -1034,7 +1045,7 @@ function A2A_SHARE_SAVE_admin_head() {
1034
  $active_services_quoted .= ',';
1035
 
1036
  // AddToAny counter enabled?
1037
- if ( in_array( $service, array( 'facebook', 'twitter', 'pinterest', 'linkedin', 'reddit' ) ) ) {
1038
  if ( isset( $_POST['addtoany_' . $service . '_show_count'] ) && $_POST['addtoany_' . $service . '_show_count'] == '1'
1039
  || ! isset( $_POST['addtoany_' . $service . '_show_count'] )
1040
  && isset( $options['special_' . $service . '_options'] )
@@ -1058,11 +1069,6 @@ function A2A_SHARE_SAVE_admin_head() {
1058
  && isset( $options['special_facebook_like_options'] ) && $options['special_facebook_like_options']['verb'] == 'recommend' ) {
1059
  ?>service_options.facebook_like = {verb: 'recommend'};<?php
1060
  }
1061
- if ( isset( $_POST['addtoany_twitter_tweet_show_count'] ) && $_POST['addtoany_twitter_tweet_show_count'] == '1'
1062
- || ! isset( $_POST['addtoany_twitter_tweet_show_count'] )
1063
- && isset( $options['special_twitter_tweet_options'] ) && $options['special_twitter_tweet_options']['show_count'] == '1' ) {
1064
- ?>service_options.twitter_tweet = {show_count: 1};<?php
1065
- }
1066
  if ( isset( $_POST['addtoany_google_plusone_show_count'] ) && $_POST['addtoany_google_plusone_show_count'] == '1'
1067
  || ! isset( $_POST['addtoany_google_plusone_show_count'] )
1068
  && isset( $options['special_google_plusone_options'] ) && $options['special_google_plusone_options']['show_count'] == '1' ) {
262
  $new_options['icon_size'] = ( isset( $_POST['A2A_SHARE_SAVE_icon_size'] ) ) ? $_POST['A2A_SHARE_SAVE_icon_size'] : '';
263
  $new_options['button'] = ( isset( $_POST['A2A_SHARE_SAVE_button'] ) ) ? $_POST['A2A_SHARE_SAVE_button'] : '';
264
  $new_options['button_custom'] = ( isset( $_POST['A2A_SHARE_SAVE_button_custom'] ) ) ? $_POST['A2A_SHARE_SAVE_button_custom'] : '';
265
+ $new_options['button_show_count'] = ( isset( $_POST['A2A_SHARE_SAVE_button_show_count'] ) && $_POST['A2A_SHARE_SAVE_button_show_count'] == '1' ) ? '1' : '-1';
266
  $new_options['header'] = ( isset( $_POST['A2A_SHARE_SAVE_header'] ) ) ? $_POST['A2A_SHARE_SAVE_header'] : '';
267
  $new_options['additional_js_variables'] = ( isset( $_POST['A2A_SHARE_SAVE_additional_js_variables'] ) ) ? trim( $_POST['A2A_SHARE_SAVE_additional_js_variables'] ) : '';
268
  $new_options['additional_css'] = ( isset( $_POST['A2A_SHARE_SAVE_additional_css'] ) ) ? trim( $_POST['A2A_SHARE_SAVE_additional_css'] ) : '';
304
  $active_services[] = $service;
305
 
306
  // AddToAny counter enabled?
307
+ if ( in_array( $service, array( 'facebook', 'pinterest', 'linkedin', 'reddit' ) ) ) {
308
  $new_options['special_' . $service . '_options'] = array(
309
  'show_count' => ( ( isset( $_POST['addtoany_' . $service . '_show_count'] ) && $_POST['addtoany_' . $service . '_show_count'] == '1') ? '1' : '-1' )
310
  );
318
  'verb' => ( ( isset( $_POST['addtoany_facebook_like_verb'] ) && $_POST['addtoany_facebook_like_verb'] == 'recommend') ? 'recommend' : 'like' )
319
  );
320
  $new_options['special_twitter_tweet_options'] = array(
321
+ 'show_count' => '-1' // Twitter doesn't provide counts anymore
322
  );
323
  $new_options['special_google_plusone_options'] = array(
324
  'show_count' => ( ( isset( $_POST['addtoany_google_plusone_show_count'] ) && $_POST['addtoany_google_plusone_show_count'] == '1' ) ? '1' : '-1' )
434
  </ul>
435
  <p id="addtoany_services_info"><?php _e("Choose the services you want below. &nbsp;Click a chosen service again to remove. &nbsp;Reorder services by dragging and dropping as they appear above.", 'add-to-any'); ?></p>
436
  <ul id="addtoany_services_selectable" class="addtoany_admin_list">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
437
  <?php
438
  // Show all services
439
  foreach ($A2A_SHARE_SAVE_services as $service_safe_name=>$site) {
445
  if ( ! isset( $site['icon'] ) )
446
  $site['icon'] = 'default';
447
 
448
+ $special_service = ( in_array( $service_safe_name, array( 'facebook', 'pinterest', 'linkedin', 'reddit' ) ) )
449
  ? ' class="addtoany_special_service"' : '';
450
  ?>
451
  <li data-addtoany-icon-name="<?php echo $site['icon']; ?>"<?php echo $special_service; ?> id="a2a_wp_<?php echo $service_safe_name; ?>" title="<?php echo $site['name']; ?>">
453
  </li>
454
  <?php
455
  } ?>
456
+ <li id="a2a_wp_facebook_like" class="addtoany_special_service addtoany_3p_button" title="Facebook Like button">
457
+ <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/facebook_like.png'; ?>" width="50" height="20" alt="Facebook Like" /></span>
458
+ </li>
459
+ <li id="a2a_wp_twitter_tweet" class="addtoany_special_service addtoany_3p_button" title="Twitter Tweet button">
460
+ <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/twitter_tweet.png'; ?>" width="55" height="20" alt="Twitter Tweet" /></span>
461
+ </li>
462
+ <li id="a2a_wp_google_plusone" class="addtoany_special_service addtoany_3p_button" title="Google +1 button">
463
+ <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/google_plusone.png'; ?>" width="32" height="20" alt="Google +1" /></span>
464
+ </li>
465
+ <li id="a2a_wp_google_plus_share" class="addtoany_special_service addtoany_3p_button" title="Google+ Share button">
466
+ <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/google_plus_share.png'; ?>" width="56" height="20" alt="Google+ Share" /></span>
467
+ </li>
468
+ <li id="a2a_wp_pinterest_pin" class="addtoany_special_service addtoany_3p_button" title="Pinterest Pin It button">
469
+ <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/pinterest_pin.png'; ?>" width="40" height="20" alt="Pinterest Pin It" /></span>
470
+ </li>
471
  </ul>
472
  </fieldset></td>
473
  </tr>
528
  <input name="A2A_SHARE_SAVE_button" value="NONE" type="radio"<?php if ( isset( $options['button'] ) && 'NONE' == $options['button'] ) echo ' checked="checked"'; ?> onclick="return confirm('<?php _e('This option will disable universal sharing. Are you sure you want to disable universal sharing?', 'add-to-any' ) ?>')" style="margin:9px 0;vertical-align:middle">
529
  <span style="margin:0 9px;vertical-align:middle"><?php _e("None"); ?></span>
530
  </label>
531
+ <br>
532
+ <label>
533
+ <input id="A2A_SHARE_SAVE_button_show_count" name="A2A_SHARE_SAVE_button_show_count" type="checkbox"<?php
534
+ if ( isset( $options['button_show_count'] ) && $options['button_show_count'] == '1' ) echo ' checked="checked"'; ?> value="1">
535
+ <span style="margin-left:5px">Show count</span>
536
+ </label>
537
 
538
  </fieldset></td>
539
  </tr>
904
  // Special service options?
905
  service_name = services_array[i].substr(7);
906
  if (service_name == 'facebook_like' || service_name == 'twitter_tweet' || service_name == 'google_plusone' || service_name == 'google_plus_share' || service_name == 'pinterest_pin') {
907
+ if (service_name == 'google_plusone' || service_name == 'google_plus_share' || service_name == 'pinterest_pin') {
908
  show_count_value = (jQuery('#' + services_array[i] + '_show_count').is(':checked')) ? '1' : '-1' ;
909
  jQuery('#addtoany_admin_form').append('<input class="addtoany_hidden_options" name="addtoany_' + service_name + '_show_count" type="hidden" value="' + show_count_value + '"/>');
910
  }
914
  jQuery('#addtoany_admin_form').append('<input class="addtoany_hidden_options" name="addtoany_' + service_name + '_verb" type="hidden" value="' + fb_verb_value + '"/>');
915
  }
916
  // AddToAny counters
917
+ } else if ( jQuery.inArray( service_name, ['facebook', 'pinterest', 'linkedin', 'reddit'] ) > -1 ) {
918
  show_count_value = (jQuery('#' + services_array[i] + '_show_count').is(':checked')) ? '1' : '-1' ;
919
  jQuery('#addtoany_admin_form').append('<input class="addtoany_hidden_options" name="addtoany_' + service_name + '_show_count" type="hidden" value="' + show_count_value + '"/>');
920
  }
945
  jQuery('#addtoany_services_sortable').find('.dummy').hide();
946
 
947
  if (this_service_is_special) {
948
+ if ('facebook_like' == this_service_name) {
949
  if (service_options[this_service_name] && service_options[this_service_name].verb)
950
  checked = ' selected="selected"';
951
  special_options_html = '<select id="' + this_service.attr('id') + '_verb" name="' + this_service.attr('id') + '_verb">'
952
  + '<option value="like">Like</option>'
953
  + '<option' + checked + ' value="recommend">Recommend</option>'
954
  + '</select>';
955
+ } else if ('twitter_tweet' == this_service_name) {
956
+ // twitter_tweet doesn't provide counts anymore
957
  } else {
958
+ // google_plusone & google_plus_share & pinterest_pin
959
  if (service_options[this_service_name] && service_options[this_service_name].show_count) {
960
  checked = ' checked="checked"';
961
  }
962
  special_options_html = '<label><input' + checked + ' id="' + this_service.attr('id') + '_show_count" name="' + this_service.attr('id') + '_show_count" type="checkbox" value="1"> Show count</label>';
963
  }
964
 
965
+ if (special_options_html.length > 0) {
966
+ configurable_html = '<span class="down_arrow"></span><br style="clear:both"/><div class="special_options">' + special_options_html + '</div>';
967
+ }
968
  }
969
 
970
  var icon_size = jQuery('input:radio[name=A2A_SHARE_SAVE_icon_size]:checked').val();
1045
  $active_services_quoted .= ',';
1046
 
1047
  // AddToAny counter enabled?
1048
+ if ( in_array( $service, array( 'facebook', 'pinterest', 'linkedin', 'reddit' ) ) ) {
1049
  if ( isset( $_POST['addtoany_' . $service . '_show_count'] ) && $_POST['addtoany_' . $service . '_show_count'] == '1'
1050
  || ! isset( $_POST['addtoany_' . $service . '_show_count'] )
1051
  && isset( $options['special_' . $service . '_options'] )
1069
  && isset( $options['special_facebook_like_options'] ) && $options['special_facebook_like_options']['verb'] == 'recommend' ) {
1070
  ?>service_options.facebook_like = {verb: 'recommend'};<?php
1071
  }
 
 
 
 
 
1072
  if ( isset( $_POST['addtoany_google_plusone_show_count'] ) && $_POST['addtoany_google_plusone_show_count'] == '1'
1073
  || ! isset( $_POST['addtoany_google_plusone_show_count'] )
1074
  && isset( $options['special_google_plusone_options'] ) && $options['special_google_plusone_options']['show_count'] == '1' ) {