AddToAny Share Buttons - Version 1.3.2

Version Description

  • Avoid loading button script in admin, especially for visual editor plugins
  • Add addtoany_script_disabled hook to programmatically disable JavaScript
Download this release

Release Info

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

Code changes from version 1.3.1 to 1.3.2

Files changed (2) hide show
  1. README.txt +9 -4
  2. add-to-any.php +18 -6
README.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Share Buttons by AddToAny ===
2
  Contributors: micropat, addtoany
3
- Tags: sharing, share, share this, bookmarking, social, share button, share buttons, share links, social share, social sharing, social bookmarking, social bookmarks, bookmark, bookmarks, save, Post, posts, page, pages, images, image, admin, statistics, stats, links, plugin, shortcode, sidebar, widget, responsive, email, e-mail, print, seo, button, delicious, google, tumblr, linkedin, digg, reddit, facebook, facebook share, facebook like, like, twitter, twitter button, twitter share, tweet, +1, plus 1, google plus, google plus one, plus one, pinterest, pin, pin it, pinit, wanelo, buffer, stumbleupon, bitly, technorati, lockerz, addthis, sociable, sharedaddy, sharethis, shareaholic, icon, icons, vector, SVG, floating, floating buttons, wpmu, Add to Any, AddToAny
4
  Requires at least: 2.8
5
- Tested up to: 3.9.1
6
- Stable tag: 1.3.1
7
 
8
  Share buttons for WordPress including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, StumbleUpon and many more.
9
 
@@ -29,7 +29,8 @@ AddToAny's customizable platform and social share icons let you optimize your si
29
  = Custom Placement =
30
  * Before content, after content, or before & after content
31
  * Vertical Floating Share Bar, and Horizontal Floating Share Bar
32
- * As a widget within a theme, and programmatically
 
33
 
34
  = Analytics Integration =
35
 
@@ -278,6 +279,10 @@ Upload the plugin directory (including all files and directories within) to the
278
 
279
  == Changelog ==
280
 
 
 
 
 
281
  = 1.3.1 =
282
  * Floating share buttons are now responsive by default
283
  * Responsive breakpoints configurable in Floating options
1
  === Share Buttons by AddToAny ===
2
  Contributors: micropat, addtoany
3
+ Tags: sharing, share, share this, bookmarking, social, share button, share buttons, share links, social share, social sharing, social bookmarking, social bookmarks, socialize, bookmark, bookmarks, save, Post, posts, page, pages, images, image, admin, statistics, stats, links, plugin, shortcode, sidebar, widget, responsive, email, e-mail, print, seo, button, delicious, google, tumblr, linkedin, digg, reddit, facebook, facebook share, facebook like, like, twitter, twitter button, twitter share, tweet, tweet button, +1, plus 1, google +1, google plus, google plus one, plus one, pinterest, pin, pin it, pinit, wanelo, buffer, stumbleupon, bitly, technorati, lockerz, addthis, sociable, sharedaddy, sharethis, shareaholic, icon, icons, vector, SVG, floating, floating buttons, wpmu, Add to Any, AddToAny
4
  Requires at least: 2.8
5
+ Tested up to: 3.9.2
6
+ Stable tag: 1.3.2
7
 
8
  Share buttons for WordPress including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, StumbleUpon and many more.
9
 
29
  = Custom Placement =
30
  * Before content, after content, or before & after content
31
  * Vertical Floating Share Bar, and Horizontal Floating Share Bar
32
+ * As a shortcode, or a widget within a theme's layout
33
+ * Programmatically with template tags
34
 
35
  = Analytics Integration =
36
 
279
 
280
  == Changelog ==
281
 
282
+ = 1.3.2 =
283
+ * Avoid loading button script in admin, especially for visual editor plugins
284
+ * Add addtoany_script_disabled hook to programmatically disable JavaScript
285
+
286
  = 1.3.1 =
287
  * Floating share buttons are now responsive by default
288
  * Responsive breakpoints configurable in Floating options
add-to-any.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Share Buttons by AddToAny
4
  Plugin URI: http://www.addtoany.com/
5
  Description: Share buttons for your pages including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, StumbleUpon and many more. [<a href="options-general.php?page=add-to-any.php">Settings</a>]
6
- Version: 1.3.1
7
  Author: AddToAny
8
  Author URI: http://www.addtoany.com/
9
  */
@@ -190,7 +190,7 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
190
  'html_container_close' => '',
191
  'html_wrap_open' => '',
192
  'html_wrap_close' => '',
193
- 'no_universal_button' => false,
194
  );
195
 
196
  $args = wp_parse_args( $args, $defaults );
@@ -385,8 +385,12 @@ function ADDTOANY_SHARE_SAVE_BUTTON( $args = array() ) {
385
  $button_html = '';
386
  }
387
 
388
- // If not a feed
389
- if ( ! $is_feed ) {
 
 
 
 
390
  if ($use_current_page) {
391
  $button_config = "\n{title:document.title,"
392
  . "url:location.href}";
@@ -597,7 +601,11 @@ function ADDTOANY_SHARE_SAVE_FLOATING( $args = array() ) {
597
 
598
 
599
  function A2A_SHARE_SAVE_head_script() {
600
- if ( is_admin() || is_feed() )
 
 
 
 
601
  return;
602
 
603
  $options = get_option( 'addtoany_options' );
@@ -673,7 +681,11 @@ add_action( 'wp_head', 'A2A_SHARE_SAVE_head_script' );
673
  function A2A_SHARE_SAVE_footer_script() {
674
  global $_addtoany_targets;
675
 
676
- if ( is_admin() || is_feed() )
 
 
 
 
677
  return;
678
 
679
  $_addtoany_targets = ( isset( $_addtoany_targets ) ) ? $_addtoany_targets : array();
3
  Plugin Name: Share Buttons by AddToAny
4
  Plugin URI: http://www.addtoany.com/
5
  Description: Share buttons for your pages including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, StumbleUpon and many more. [<a href="options-general.php?page=add-to-any.php">Settings</a>]
6
+ Version: 1.3.2
7
  Author: AddToAny
8
  Author URI: http://www.addtoany.com/
9
  */
190
  'html_container_close' => '',
191
  'html_wrap_open' => '',
192
  'html_wrap_close' => '',
193
+ 'no_universal_button' => false,
194
  );
195
 
196
  $args = wp_parse_args( $args, $defaults );
385
  $button_html = '';
386
  }
387
 
388
+ // Hook to disable script output
389
+ // Example: add_filter( 'addtoany_script_disabled', '__return_true' );
390
+ $script_disabled = apply_filters( 'addtoany_script_disabled', false );
391
+
392
+ // If not a feed, not admin, and script is not disabled
393
+ if ( ! $is_feed && ! is_admin() && ! $script_disabled ) {
394
  if ($use_current_page) {
395
  $button_config = "\n{title:document.title,"
396
  . "url:location.href}";
601
 
602
 
603
  function A2A_SHARE_SAVE_head_script() {
604
+ // Hook to disable script output
605
+ // Example: add_filter( 'addtoany_script_disabled', '__return_true' );
606
+ $script_disabled = apply_filters( 'addtoany_script_disabled', false );
607
+
608
+ if ( is_admin() || is_feed() || $script_disabled )
609
  return;
610
 
611
  $options = get_option( 'addtoany_options' );
681
  function A2A_SHARE_SAVE_footer_script() {
682
  global $_addtoany_targets;
683
 
684
+ // Hook to disable script output
685
+ // Example: add_filter( 'addtoany_script_disabled', '__return_true' );
686
+ $script_disabled = apply_filters( 'addtoany_script_disabled', false );
687
+
688
+ if ( is_admin() || is_feed() || $script_disabled )
689
  return;
690
 
691
  $_addtoany_targets = ( isset( $_addtoany_targets ) ) ? $_addtoany_targets : array();