AddToAny Share Buttons - Version 0.9.9.7.10

Version Description

Download this release

Release Info

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

Code changes from version 0.9.9.7.9 to 0.9.9.7.10

Files changed (2) hide show
  1. README.txt +16 -10
  2. add-to-any.php +36 -36
README.txt CHANGED
@@ -1,25 +1,25 @@
1
- === AddToAny: Share/Bookmark/Email Button ===
2
  Contributors: micropat
3
- Tags: sharing, share, sharethis, bookmarking, social, social bookmarking, social bookmarks, bookmark, bookmarks, save, Post, posts, page, pages, images, image, admin, statistics, stats, links, plugin, widget, email, e-mail, seo, button, delicious, google buzz, buzz, google, digg, reddit, facebook, facebook like, like, myspace, twitter, tweet, messenger, stumbleupon, technorati, sexybookmarks, sociable, sharedaddy, icon, icons, wpmu, addtoany, add
4
  Requires at least: 2.8
5
  Tested up to: 3.1
6
- Stable tag: 0.9.9.7.9
7
 
8
- Help people share, bookmark, and email your posts & pages using any service, such as Facebook, Twitter, Google Buzz, Digg and many more.
9
 
10
  == Description ==
11
 
12
- The WordPress plugin to help people **share**, **bookmark**, and **email** your posts and pages using any service, such as Facebook, Twitter, Google Buzz, Digg, Delicious, and well over 100 more sharing and social bookmarking sites. New: **Facebook Like Button** and **Twitter Tweet Button**.
13
 
14
  This sharing plugin comes with AddToAny's customizable Smart Menu, which places the services visitors use at the top of the menu, based on each visitor's browsing and usage history.
15
 
16
- <a href="http://www.addtoany.com/" title="Sharing and bookmarking button widget" target="_blank">Share Button</a> (demo)
17
 
18
  The Email tab makes it easy to share via Google Gmail, Yahoo! Mail, Hotmail, AOL, and any other web-based emailer or desktop program. The Add to Favorites button (or Bookmark tab) helps users bookmark using any browser (Internet Explorer, Firefox, Chrome, Safari, Opera, etc.).
19
 
20
  Standalone **share icons** let you optimize your blog posts for specific social sites. Choose from over 100 individual services.
21
 
22
- * AddToAny <a href="http://www.addtoany.com/blog/smart-menus-the-services-your-visitors-use-displayed-first/" target="_blank">Smart Menu</a> & <a href="http://www.addtoany.com/buttons/customize/standalone_services" target="_blank">AddToAny Kit</a>
23
  * Individual share links (like Sociable)
24
  * Includes all <a href="http://www.addtoany.com/services/" target="_blank">services</a>
25
  * Google Analytics integration (<a href="http://www.addtoany.com/ext/google_analytics/">access guide</a>)
@@ -29,13 +29,13 @@ Standalone **share icons** let you optimize your blog posts for specific social
29
 
30
  After **years of active development**, over **1.5 million downloads**, and **ongoing support from the community**, AddToAny still strives to be the best WordPress plugin for sharing. We hope it's perfect for everyone by version 1.0.
31
 
32
- <a href="http://www.addtoany.com/share_save" title="Share">Share this plugin</a>
33
 
34
  See also:
35
 
36
- * The <a href="/extend/plugins/add-to-any-subscribe/" title="WordPress RSS Subscribe widget plugin">Subscribe button</a> plugin
37
- * The <a href="http://www.addtoany.com/buttons/for/wordpress_com" title="WordPress.com sharing button widget">Share button for WordPress.com</a> blogs
38
  * The standard <a href="http://www.addtoany.com/buttons/">Share button</a> widget
 
 
39
 
40
  <a href="http://www.addtoany.com/blog/">AddToAny Blog</a> | <a href="http://www.addtoany.com/privacy">Privacy Policy</a>
41
 
@@ -177,6 +177,12 @@ Please read <a href="http://www.addtoany.com/buttons/customize/show_over_embeds"
177
 
178
  == Changelog ==
179
 
 
 
 
 
 
 
180
  = .9.9.7.9 =
181
  * Fix global options
182
  * Fix options variable debug mode notice
1
+ === AddToAny: Share/Bookmark/Email Buttons ===
2
  Contributors: micropat
3
+ Tags: sharing, share, sharethis, bookmarking, social, social bookmarking, social bookmarks, bookmark, bookmarks, save, Post, posts, page, pages, images, image, admin, statistics, stats, links, plugin, widget, email, e-mail, seo, button, delicious, google buzz, buzz, google, digg, reddit, facebook, facebook like, like, myspace, twitter, tweet, messenger, stumbleupon, technorati, sexybookmarks, sociable, sharedaddy, icon, icons, wpmu, addtoany
4
  Requires at least: 2.8
5
  Tested up to: 3.1
6
+ Stable tag: 0.9.9.7.10
7
 
8
+ Help people share, bookmark, and email your posts & pages using any service, such as Facebook, Twitter, StumbleUpon, Digg and many more.
9
 
10
  == Description ==
11
 
12
+ The WordPress plugin to help people **share**, **bookmark**, and **email** your posts and pages using any service, such as Facebook, Twitter, StumbleUpon, Google, Digg, Delicious, and well over 100 more sharing and social bookmarking sites. New: **Facebook Like Button** and **Twitter Tweet Button**.
13
 
14
  This sharing plugin comes with AddToAny's customizable Smart Menu, which places the services visitors use at the top of the menu, based on each visitor's browsing and usage history.
15
 
16
+ <a href="http://www.addtoany.com/" title="Sharing button widget" target="_blank">Share Button</a> (demo)
17
 
18
  The Email tab makes it easy to share via Google Gmail, Yahoo! Mail, Hotmail, AOL, and any other web-based emailer or desktop program. The Add to Favorites button (or Bookmark tab) helps users bookmark using any browser (Internet Explorer, Firefox, Chrome, Safari, Opera, etc.).
19
 
20
  Standalone **share icons** let you optimize your blog posts for specific social sites. Choose from over 100 individual services.
21
 
22
+ * AddToAny Smart Menu & <a href="http://www.addtoany.com/buttons/customize/standalone_services" target="_blank">AddToAny Kit</a>
23
  * Individual share links (like Sociable)
24
  * Includes all <a href="http://www.addtoany.com/services/" target="_blank">services</a>
25
  * Google Analytics integration (<a href="http://www.addtoany.com/ext/google_analytics/">access guide</a>)
29
 
30
  After **years of active development**, over **1.5 million downloads**, and **ongoing support from the community**, AddToAny still strives to be the best WordPress plugin for sharing. We hope it's perfect for everyone by version 1.0.
31
 
32
+ <a href="http://www.addtoany.com/share_save" title="Share">Share this</a> plugin
33
 
34
  See also:
35
 
 
 
36
  * The standard <a href="http://www.addtoany.com/buttons/">Share button</a> widget
37
+ * The <a href="http://www.addtoany.com/buttons/for/wordpress_com" title="WordPress.com sharing button widget">Share button for WordPress.com</a> blogs
38
+ * The <a href="/extend/plugins/add-to-any-subscribe/" title="WordPress RSS Subscribe widget plugin">Subscribe button</a> plugin
39
 
40
  <a href="http://www.addtoany.com/blog/">AddToAny Blog</a> | <a href="http://www.addtoany.com/privacy">Privacy Policy</a>
41
 
177
 
178
  == Changelog ==
179
 
180
+ = .9.9.7.10 =
181
+ * Fix initial button text for 16px icons in admin
182
+ * Harden global options
183
+ * Move conditional logic into hooks
184
+ * Remove WP 2.6 version detection for jQuery UI and version globals
185
+
186
  = .9.9.7.9 =
187
  * Fix global options
188
  * Fix options variable debug mode notice
add-to-any.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /*
3
- Plugin Name: AddToAny: Share/Bookmark/Email Button
4
  Plugin URI: http://www.addtoany.com/
5
- Description: Help people share, bookmark, and email your posts & pages using any service, such as Facebook, Twitter, Google Buzz, Digg and many more. [<a href="options-general.php?page=add-to-any.php">Settings</a>]
6
- Version: .9.9.7.9
7
  Author: AddToAny
8
  Author URI: http://www.addtoany.com/
9
  */
@@ -12,7 +12,7 @@ if( !isset($A2A_locale) )
12
  $A2A_locale = '';
13
 
14
  // Pre-2.6 compatibility
15
- if ( !defined('WP_CONTENT_URL') )
16
  define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
17
  if ( ! defined( 'WP_PLUGIN_URL' ) )
18
  define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' );
@@ -27,15 +27,24 @@ if (is_ssl())
27
  $A2A_SHARE_SAVE_options = get_option('addtoany_options');
28
 
29
  function A2A_SHARE_SAVE_init() {
30
- global $A2A_SHARE_SAVE_plugin_url_path, $A2A_SHARE_SAVE_plugin_basename;
 
 
31
 
32
  if (get_option('A2A_SHARE_SAVE_button')) {
33
  A2A_SHARE_SAVE_migrate_options();
 
34
  }
35
 
36
  load_plugin_textdomain('add-to-any',
37
  $A2A_SHARE_SAVE_plugin_url_path.'/languages',
38
  $A2A_SHARE_SAVE_plugin_basename.'/languages');
 
 
 
 
 
 
39
  }
40
  add_filter('init', 'A2A_SHARE_SAVE_init');
41
 
@@ -84,7 +93,8 @@ function ADDTOANY_SHARE_SAVE_KIT( $args = false ) {
84
  function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
85
  // $args array: output_later, html_container_open, html_container_close, html_wrap_open, html_wrap_close, linkname, linkurl
86
 
87
- global $A2A_SHARE_SAVE_plugin_url_path, $A2A_SHARE_SAVE_services;
 
88
 
89
  $linkname = (isset($args['linkname'])) ? $args['linkname'] : FALSE;
90
  $linkurl = (isset($args['linkurl'])) ? $args['linkurl'] : FALSE;
@@ -487,12 +497,6 @@ function A2A_SHARE_SAVE_add_to_content($content) {
487
  add_filter('the_title', 'A2A_SHARE_SAVE_auto_placement', 9);
488
  add_filter('the_content', 'A2A_SHARE_SAVE_add_to_content', 98);
489
 
490
- if ($A2A_SHARE_SAVE_options['display_in_excerpts'] != '-1') {
491
- // Excerpts use strip_tags() for the_content, so cancel if Excerpt and append to the_excerpt instead
492
- add_filter('get_the_excerpt', 'A2A_SHARE_SAVE_remove_from_content', 9);
493
- add_filter('the_excerpt', 'A2A_SHARE_SAVE_add_to_content', 98);
494
- }
495
-
496
 
497
  function A2A_SHARE_SAVE_button_css_IE() {
498
  /* IE support for opacity: */ ?>
@@ -505,14 +509,20 @@ function A2A_SHARE_SAVE_button_css_IE() {
505
  <?php
506
  }
507
 
508
- // Use stylesheet?
509
- if ($A2A_SHARE_SAVE_options['inline_css'] != '-1' && ! is_admin()) {
510
- wp_enqueue_style('A2A_SHARE_SAVE', $A2A_SHARE_SAVE_plugin_url_path . '/addtoany.min.css', false, '1.3');
511
 
512
- // Conditional inline CSS stylesheet for IE
513
- add_filter('wp_head', 'A2A_SHARE_SAVE_button_css_IE');
 
 
 
 
 
514
  }
515
 
 
 
516
 
517
 
518
  /*****************************
@@ -614,7 +624,8 @@ function A2A_SHARE_SAVE_migrate_options() {
614
 
615
  function A2A_SHARE_SAVE_options_page() {
616
 
617
- global $A2A_SHARE_SAVE_plugin_url_path, $A2A_SHARE_SAVE_services, $wp_version;
 
618
 
619
  // Require admin privs
620
  if ( ! current_user_can('manage_options') )
@@ -740,7 +751,6 @@ function A2A_SHARE_SAVE_options_page() {
740
  <?php wp_nonce_field('add-to-any-update-options'); ?>
741
 
742
  <table class="form-table">
743
- <?php if ($wp_version >= "2.6") { /* Must be on WP 2.6+ */ ?>
744
  <tr valign="top">
745
  <th scope="row"><?php _e("Standalone Services", "add-to-any"); ?></th>
746
  <td><fieldset>
@@ -777,7 +787,6 @@ function A2A_SHARE_SAVE_options_page() {
777
  </ul>
778
  </fieldset></td>
779
  </tr>
780
- <?php } ?>
781
  <tr valign="top">
782
  <th scope="row"><?php _e("Button", "add-to-any"); ?></th>
783
  <td><fieldset>
@@ -788,7 +797,7 @@ function A2A_SHARE_SAVE_options_page() {
788
  onclick="this.parentNode.firstChild.checked=true"/>
789
  </label>
790
  <input name="A2A_SHARE_SAVE_button_favicon_16_16_text" type="text" class="code" size="50" onclick="e=document.getElementsByName('A2A_SHARE_SAVE_button');e[e.length-7].checked=true" style="vertical-align:middle;width:150px"
791
- value="<?php echo ($options['button_text'] !== FALSE) ? stripslashes($options['button_text']) : __('Share/Bookmark','add-to-any'); ?>" />
792
  <label style="padding-left:9px">
793
  <input name="A2A_SHARE_SAVE_button" value="share_16_16.png|16|16" type="radio"<?php if($options['button']=='share_16_16.png|16|16') echo ' checked="checked"'; ?>
794
  style="margin:9px 0;vertical-align:middle">
@@ -796,7 +805,7 @@ function A2A_SHARE_SAVE_options_page() {
796
  onclick="this.parentNode.firstChild.checked=true"/>
797
  </label>
798
  <input name="A2A_SHARE_SAVE_button_share_16_16_text" type="text" class="code" size="50" onclick="e=document.getElementsByName('A2A_SHARE_SAVE_button');e[e.length-6].checked=true" style="vertical-align:middle;width:150px"
799
- value="<?php echo ($options['button_text'] !== FALSE) ? stripslashes($options['button_text']) : __('Share/Bookmark','add-to-any'); ?>" /><br>
800
  <label>
801
  <input name="A2A_SHARE_SAVE_button" value="share_save_120_16.png|120|16" type="radio"<?php if($options['button']=='share_save_120_16.png|120|16') echo ' checked="checked"'; ?>
802
  style="margin:9px 0;vertical-align:middle">
@@ -966,13 +975,8 @@ function A2A_SHARE_SAVE_options_page() {
966
  // Admin page header
967
  function A2A_SHARE_SAVE_admin_head() {
968
  if (isset($_GET['page']) && $_GET['page'] == 'add-to-any.php') {
969
- global $wp_version;
970
-
971
- // Must be on WP 2.6+
972
- if ($wp_version < "2.6")
973
- return;
974
 
975
- $options = get_option('addtoany_options');
976
 
977
  ?>
978
  <script type="text/javascript"><!--
@@ -1063,9 +1067,11 @@ function A2A_SHARE_SAVE_admin_head() {
1063
  $admin_services_saved = is_array($_POST['A2A_SHARE_SAVE_active_services']) || isset($_POST['Submit']);
1064
  $active_services = ( $admin_services_saved )
1065
  ? $_POST['A2A_SHARE_SAVE_active_services'] : $options['active_services'];
1066
- if( !$active_services )
1067
  $active_services = Array();
1068
  $active_services_last = end($active_services);
 
 
1069
  $active_services_quoted = '';
1070
  foreach ($active_services as $service) {
1071
  if($admin_services_saved)
@@ -1151,13 +1157,7 @@ function A2A_SHARE_SAVE_add_menu_link() {
1151
  }
1152
 
1153
  function A2A_SHARE_SAVE_scripts() {
1154
- global $wp_version;
1155
-
1156
- // Load jQuery UI Sortable
1157
- // Must be on WP 2.6+
1158
- if ($wp_version >= "2.6") {
1159
- wp_enqueue_script('jquery-ui-sortable');
1160
- }
1161
  }
1162
 
1163
  add_filter('admin_menu', 'A2A_SHARE_SAVE_add_menu_link');
1
  <?php
2
  /*
3
+ Plugin Name: AddToAny: Share/Bookmark/Email Buttons
4
  Plugin URI: http://www.addtoany.com/
5
+ Description: Help people share, bookmark, and email your posts & pages using any service, such as Facebook, Twitter, StumbleUpon, Digg and many more. [<a href="options-general.php?page=add-to-any.php">Settings</a>]
6
+ Version: .9.9.7.10
7
  Author: AddToAny
8
  Author URI: http://www.addtoany.com/
9
  */
12
  $A2A_locale = '';
13
 
14
  // Pre-2.6 compatibility
15
+ if ( ! defined('WP_CONTENT_URL') )
16
  define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
17
  if ( ! defined( 'WP_PLUGIN_URL' ) )
18
  define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' );
27
  $A2A_SHARE_SAVE_options = get_option('addtoany_options');
28
 
29
  function A2A_SHARE_SAVE_init() {
30
+ global $A2A_SHARE_SAVE_plugin_url_path,
31
+ $A2A_SHARE_SAVE_plugin_basename,
32
+ $A2A_SHARE_SAVE_options;
33
 
34
  if (get_option('A2A_SHARE_SAVE_button')) {
35
  A2A_SHARE_SAVE_migrate_options();
36
+ $A2A_SHARE_SAVE_options = get_option('addtoany_options');
37
  }
38
 
39
  load_plugin_textdomain('add-to-any',
40
  $A2A_SHARE_SAVE_plugin_url_path.'/languages',
41
  $A2A_SHARE_SAVE_plugin_basename.'/languages');
42
+
43
+ if ($A2A_SHARE_SAVE_options['display_in_excerpts'] != '-1') {
44
+ // Excerpts use strip_tags() for the_content, so cancel if Excerpt and append to the_excerpt instead
45
+ add_filter('get_the_excerpt', 'A2A_SHARE_SAVE_remove_from_content', 9);
46
+ add_filter('the_excerpt', 'A2A_SHARE_SAVE_add_to_content', 98);
47
+ }
48
  }
49
  add_filter('init', 'A2A_SHARE_SAVE_init');
50
 
93
  function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
94
  // $args array: output_later, html_container_open, html_container_close, html_wrap_open, html_wrap_close, linkname, linkurl
95
 
96
+ global $A2A_SHARE_SAVE_plugin_url_path,
97
+ $A2A_SHARE_SAVE_services;
98
 
99
  $linkname = (isset($args['linkname'])) ? $args['linkname'] : FALSE;
100
  $linkurl = (isset($args['linkurl'])) ? $args['linkurl'] : FALSE;
497
  add_filter('the_title', 'A2A_SHARE_SAVE_auto_placement', 9);
498
  add_filter('the_content', 'A2A_SHARE_SAVE_add_to_content', 98);
499
 
 
 
 
 
 
 
500
 
501
  function A2A_SHARE_SAVE_button_css_IE() {
502
  /* IE support for opacity: */ ?>
509
  <?php
510
  }
511
 
512
+ function A2A_SHARE_SAVE_stylesheet() {
513
+ global $A2A_SHARE_SAVE_options, $A2A_SHARE_SAVE_plugin_url_path;
 
514
 
515
+ // Use stylesheet?
516
+ if ($A2A_SHARE_SAVE_options['inline_css'] != '-1' && ! is_admin()) {
517
+ wp_enqueue_style('A2A_SHARE_SAVE', $A2A_SHARE_SAVE_plugin_url_path . '/addtoany.min.css', false, '1.3');
518
+
519
+ // Conditional inline CSS stylesheet for IE
520
+ add_filter('wp_head', 'A2A_SHARE_SAVE_button_css_IE');
521
+ }
522
  }
523
 
524
+ add_action('wp_print_styles', 'A2A_SHARE_SAVE_stylesheet');
525
+
526
 
527
 
528
  /*****************************
624
 
625
  function A2A_SHARE_SAVE_options_page() {
626
 
627
+ global $A2A_SHARE_SAVE_plugin_url_path,
628
+ $A2A_SHARE_SAVE_services;
629
 
630
  // Require admin privs
631
  if ( ! current_user_can('manage_options') )
751
  <?php wp_nonce_field('add-to-any-update-options'); ?>
752
 
753
  <table class="form-table">
 
754
  <tr valign="top">
755
  <th scope="row"><?php _e("Standalone Services", "add-to-any"); ?></th>
756
  <td><fieldset>
787
  </ul>
788
  </fieldset></td>
789
  </tr>
 
790
  <tr valign="top">
791
  <th scope="row"><?php _e("Button", "add-to-any"); ?></th>
792
  <td><fieldset>
797
  onclick="this.parentNode.firstChild.checked=true"/>
798
  </label>
799
  <input name="A2A_SHARE_SAVE_button_favicon_16_16_text" type="text" class="code" size="50" onclick="e=document.getElementsByName('A2A_SHARE_SAVE_button');e[e.length-7].checked=true" style="vertical-align:middle;width:150px"
800
+ value="<?php echo ( trim($options['button_text']) != '' ) ? stripslashes($options['button_text']) : __('Share/Bookmark','add-to-any'); ?>" />
801
  <label style="padding-left:9px">
802
  <input name="A2A_SHARE_SAVE_button" value="share_16_16.png|16|16" type="radio"<?php if($options['button']=='share_16_16.png|16|16') echo ' checked="checked"'; ?>
803
  style="margin:9px 0;vertical-align:middle">
805
  onclick="this.parentNode.firstChild.checked=true"/>
806
  </label>
807
  <input name="A2A_SHARE_SAVE_button_share_16_16_text" type="text" class="code" size="50" onclick="e=document.getElementsByName('A2A_SHARE_SAVE_button');e[e.length-6].checked=true" style="vertical-align:middle;width:150px"
808
+ value="<?php echo ( trim($options['button_text']) != '' ) ? stripslashes($options['button_text']) : __('Share/Bookmark','add-to-any'); ?>" /><br>
809
  <label>
810
  <input name="A2A_SHARE_SAVE_button" value="share_save_120_16.png|120|16" type="radio"<?php if($options['button']=='share_save_120_16.png|120|16') echo ' checked="checked"'; ?>
811
  style="margin:9px 0;vertical-align:middle">
975
  // Admin page header
976
  function A2A_SHARE_SAVE_admin_head() {
977
  if (isset($_GET['page']) && $_GET['page'] == 'add-to-any.php') {
 
 
 
 
 
978
 
979
+ $options = get_option('addtoany_options');
980
 
981
  ?>
982
  <script type="text/javascript"><!--
1067
  $admin_services_saved = is_array($_POST['A2A_SHARE_SAVE_active_services']) || isset($_POST['Submit']);
1068
  $active_services = ( $admin_services_saved )
1069
  ? $_POST['A2A_SHARE_SAVE_active_services'] : $options['active_services'];
1070
+ if( ! $active_services )
1071
  $active_services = Array();
1072
  $active_services_last = end($active_services);
1073
+ if($admin_services_saved)
1074
+ $active_services_last = substr($active_services_last, 7); // Remove a2a_wp_
1075
  $active_services_quoted = '';
1076
  foreach ($active_services as $service) {
1077
  if($admin_services_saved)
1157
  }
1158
 
1159
  function A2A_SHARE_SAVE_scripts() {
1160
+ wp_enqueue_script('jquery-ui-sortable');
 
 
 
 
 
 
1161
  }
1162
 
1163
  add_filter('admin_menu', 'A2A_SHARE_SAVE_add_menu_link');